summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2023-05-09 20:02:13 +0000
committerJacob Moody <moody@posixcafe.org>2023-05-09 20:02:13 +0000
commit91ae69be3306c807ae5bfa7d1b7ced8c239f9214 (patch)
tree4bd19ace41c10c83757c6d5850b200272c297618 /sys
parent98b8e7609c725beeb7520863b3d0e07d95396e05 (diff)
libmach: remove obsolete fishy case in mips header parsing
This code seems to be for the specific case of when mips 3000 binaries were being run on a mips 4000 kernel. As far as I know, our only current mips magic refers to the 5000 (at least), and the 4000 specific magic formats are mostly a relic. There is currently no bootable system in which this code path is correct. In any case, hardcoding /proc/1 is not the solution.
Diffstat (limited to 'sys')
-rw-r--r--sys/src/libmach/executable.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/sys/src/libmach/executable.c b/sys/src/libmach/executable.c
index 46b1a07d7..d9ef43988 100644
--- a/sys/src/libmach/executable.c
+++ b/sys/src/libmach/executable.c
@@ -248,27 +248,6 @@ ExecTable exectab[] =
Mach *mach = &mi386; /* Global current machine table */
-static ExecTable*
-couldbe4k(ExecTable *mp)
-{
- Dir *d;
- ExecTable *f;
-
- if((d=dirstat("/proc/1/regs")) == nil)
- return mp;
- if(d->length < 32*8){ /* R3000 */
- free(d);
- return mp;
- }
- free(d);
- for (f = exectab; f->magic; f++)
- if(f->magic == M_MAGIC) {
- f->name = "mips plan 9 executable on mips2 kernel";
- return f;
- }
- return mp;
-}
-
int
crackhdr(int fd, Fhdr *fp)
{
@@ -302,9 +281,6 @@ crackhdr(int fd, Fhdr *fp)
if(mp->magic != (magic & ~DYN_MAGIC))
continue;
- if(mp->magic == V_MAGIC)
- mp = couldbe4k(mp);
-
if ((magic & DYN_MAGIC) && mp->dlmname != nil)
fp->name = mp->dlmname;
else