From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 16396 invoked from network); 9 May 2023 17:39:41 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 9 May 2023 17:39:41 -0000 Received: from mail.posixcafe.org ([45.76.19.58]) by 9front; Tue May 9 13:38:26 -0400 2023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posixcafe.org; s=20200506; t=1683653951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2u/cSsCep1JDfC87sZfBLcPs5X4lJYp7QbOKhn5UEY=; b=UPbtWF9s6bX1wSKGESmKwHFeNvJ7Y/HXxpPy+7EK3GXHI/1RAfuXoYpaJvM7nYnNW4lE2I Pkp10CyOzI9GZW+PysIFgDwZewJULVhb85j/jXCNASiG7twQkoiIjFAH3joUmHxOY7U8I9 dtagGOJgrU1ekPO7CCk+3nQha1wC6GM= Received: from [192.168.168.200] (161-097-205-025.v4.mynextlight.net [161.97.205.25]) by mail.posixcafe.org (OpenSMTPD) with ESMTPSA id 48b7084a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9front@9front.org>; Tue, 9 May 2023 12:39:09 -0500 (CDT) Message-ID: Date: Tue, 9 May 2023 11:38:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: 9front@9front.org From: Jacob Moody Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: non-blocking open out-scaling metadata deep-learning manager Subject: [9front] [PATCH] remove hacky /proc/1/regs check in libmach Reply-To: 9front@9front.org Precedence: bulk While reading through this code I noticed what seemed to be this hack. I would expect libmach to parse binary files on disk the same no matter what the /proc of the program doing the analysis looks like. From my reading of the code, I dont think we still care about the difference between the 4000 and 3000 chips do we? My quick look did not seem to indicate we currently have a kernel for it, nor can I see a way to get vc to generate a binary with this magic anyhow. diff 090af6255bebf0129c891116b53b31808fe49dc7 uncommitted --- a/sys/src/libmach/executable.c +++ b/sys/src/libmach/executable.c @@ -248,27 +248,6 @@ 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) { @@ -301,9 +280,6 @@ if(mp->_magic){ 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;