Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2001 16:23:42 -0800
From:      "David O'Brien" <TrimYourCc@NUXI.com>
To:        Warner Losh <imp@harmony.village.org>
Cc:        arch@FreeBSD.ORG
Subject:   Re: sysctl kern.fallback_elf_brand
Message-ID:  <20010223162342.E72750@dragon.nuxi.com>
In-Reply-To: <200102232026.f1NKQaW82988@harmony.village.org>; from imp@harmony.village.org on Fri, Feb 23, 2001 at 01:26:36PM -0700
References:  <20010223121449.B68586@dragon.nuxi.com> <20010223043149.C2539@dragon.nuxi.com> <20010222233800.A1394@mollari.cthul.hu> <3A960EF8.75C3FC53@cup.hp.com> <20010222233800.A1394@mollari.cthul.hu> <200102230812.f1N8CVW79145@harmony.village.org> <20010223043149.C2539@dragon.nuxi.com> <200102231720.f1NHKXN00386@billy-club.village.org> <20010223121449.B68586@dragon.nuxi.com> <200102232026.f1NKQaW82988@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 23, 2001 at 01:26:36PM -0700, Warner Losh wrote:
> In message <20010223121449.B68586@dragon.nuxi.com> "David O'Brien" writes:
> : > Yes, really.  It is strip that is doing this.  I have verified this on
> : > a 4.0 system that we have in house with od.  It was producing
> : > different binaries than the 4.2-beta system and the only difference
> : > was the brand byte (0 vs 9).
> : 
> : That is because the branding method changed.  Again, go look at either
> : the code of sys/kern/imgact_elf.c or contrib/binutils/bfd/elf.c.
> 
> Translated into a useful answer:
> 	The old brand byte of 0 won't cause problems because the old
> 	branding is different than the linux binaries causing
> 	problems.

I can't even understand that translation.

The old way of branding was to write "FreeBSD" into an unused (but
reserved) area of the ELF header.  An e_ident value of "0" means "NONE
specified".  Now it means "SysV".  Currently we brand ELF binaries in
three ways:

* writing the string "FreeBSD" into the header
* setting e_ident to "ELFOSABI_FREEBSD" (which could theoretically,
  potentially create problems with "generic" ELF processing tools
* append a ".note.ABI-tag" ELF section that follows the format used by
  NetBSD (http://www.netbsd.org/Documentation/kernel/elf-notes.html)

The difference you noted was that old 4.0 binaries did not set the
e_ident ELF header field to anything.  If I removed (1) above as I
should, you would also have seen that difference of course.

-- 
-- David  (obrien@FreeBSD.org)
          GNU is Not Unix / Linux Is Not UniX

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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