From 91ae69be3306c807ae5bfa7d1b7ced8c239f9214 Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Tue, 9 May 2023 20:02:13 +0000 Subject: 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. --- sys/src/libmach/executable.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'sys/src/libmach') 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 -- cgit v1.2.3