From owner-freebsd-arch Tue May 7 23:28:42 2002 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wemm.org (12-232-135-171.client.attbi.com [12.232.135.171]) by hub.freebsd.org (Postfix) with ESMTP id B67B537B401 for ; Tue, 7 May 2002 23:28:37 -0700 (PDT) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (8.11.6/8.11.6) with ESMTP id g486Sb431400 for ; Tue, 7 May 2002 23:28:37 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id 696D738CC; Tue, 7 May 2002 23:28:37 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Nathan Hawkins Cc: arch@FreeBSD.ORG Subject: Re: syscall changes to deal with 32->64 changes. In-Reply-To: <3CD823E8.2010809@quic.net> Date: Tue, 07 May 2002 23:28:37 -0700 From: Peter Wemm Message-Id: <20020508062837.696D738CC@overcee.wemm.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nathan Hawkins wrote: > David O'Brien wrote: > > >On Tue, May 07, 2002 at 12:18:31PM -0400, Nathan Hawkins wrote: > > > > > >>I'd like to see FreeBSD start using ELF .note.ABI-tag sections to handle > >>the binary OS type/versioning. I know that at least NetBSD, Linux and > >>Hurd do it this way, and I think most others do too. > >> > >> > > > >Why? Just to follow the NIH herd? The EI_OSABI and EI_ABIVERSION fields > >were in the gABI spec before anyone started using .note sections for > >this. > > > > > Because AFAICS, it's a defacto, unwritten standard. Even if it violates > spec. > > NIH is a matter of perspective. FreeBSD could be considered to be in NIH > mode, because the other ELF based systems use a different method. I seem to recall that NetBSD invented .note.ABI-tag and pushed it back to the binutils folks. In a later revision of ELF, the EI_OSABI stuff was added. .note.ABI-tag predated those additions. When FreeBSD first started dabbling with ELF, the NetBSD folks were tinkering with the .note (and PT_NOTE executable header) stuff, and Linux had a "personality" syscall. For linux, ELF executables started up in "SVR4 mode" and the personality syscall changed it to "linux". (SYS_personality was a syscall number that didn't exist on SVR4). We didn't do *anything* with note sections till much much later on. We still have an emulation stub for it.. see sys/compat/linux/linux_misc.c /* * UGH! This is just about the dumbest idea I've ever heard!! */ int linux_personality(struct thread *td, struct linux_personality_args *args) { #ifdef DEBUG if (ldebug(personality)) printf(ARGS(personality, "%d"), args->per); #endif #ifndef __alpha__ if (args->per != 0) return EINVAL; #endif /* Yes Jim, it's still a Linux... */ td->td_retval[0] = 0; return 0; } Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message