Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 May 2002 23:28:37 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Nathan Hawkins <utsl@quic.net>
Cc:        arch@FreeBSD.ORG
Subject:   Re: syscall changes to deal with 32->64 changes. 
Message-ID:  <20020508062837.696D738CC@overcee.wemm.org>
In-Reply-To: <3CD823E8.2010809@quic.net> 

index | next in thread | previous in thread | raw e-mail

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



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020508062837.696D738CC>