RFC: Changing ELFOSABI_FREEBSD into ELFOSABI_SYSV/ELFOSABI_NONE

Robert Millan rmh at aybabtu.com
Wed Jan 4 09:29:17 UTC 2006


On Wed, Jan 04, 2006 at 08:39:12AM +0100, Robert Millan wrote:
> 
> This was added by Bruno.  Note that unlike the other kernels (including
> kNetBSD), kFreeBSD is using weird variant of ELF.  See what Bruno said:
> 
>   http://sourceware.org/ml/binutils/2002-07/msg00103.html

I overlooked some very interesting followups in that thread (I suggest you
have a look).  Interesting comments:

David O'Brien:
> This isn't 100% accurate.  For dynamic binaries, the branding is not
> required and the kernel will "accept" (load and run) them fine.
> 
> For static binaries this is true.

Bruno Haible:
> Alan Modra writes:
> > Which "branding" scheme do you want to be default, the one somewhat
> > incompatible with the ELF standard or the one more grossly
> > incompatible?  ;)
> 
> The grossly incompatible one, because that's the format that all
> FreeBSD kernel versions support.
> 
> [...]
> 
> I think we should wait two years or so before making
> NEW_FREEBSD_ABI_LABEL the default.


Bruno's initial patch contained:
+ #ifdef NEW_FREEBSD_ABI_LABEL
+   /* Put an ABI label supported by FreeBSD >= 4.1.  */
+   i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+ #else
+   memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
+ #endif


In today's binutils, we have:

  /* Put an ABI label supported by FreeBSD >= 4.1.  */
  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
#ifdef OLD_FREEBSD_ABI_LABEL
  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
#endif


(OLD_FREEBSD_ABI_LABEL is activated in bfd/config.bfd, but ONLY for old <= 4.0
versions)

In short: ignore everything I said =)

-- 
Robert Millan



More information about the Glibc-bsd-devel mailing list