From owner-freebsd-arch Fri Feb 23 16:23:49 2001 Delivered-To: freebsd-arch@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [209.152.133.57]) by hub.freebsd.org (Postfix) with ESMTP id 2AFCB37B401 for ; Fri, 23 Feb 2001 16:23:46 -0800 (PST) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.2/8.11.1) id f1O0NgS73994; Fri, 23 Feb 2001 16:23:42 -0800 (PST) (envelope-from obrien) Date: Fri, 23 Feb 2001 16:23:42 -0800 From: "David O'Brien" To: Warner Losh Cc: arch@FreeBSD.ORG Subject: Re: sysctl kern.fallback_elf_brand Message-ID: <20010223162342.E72750@dragon.nuxi.com> Reply-To: arch@FreeBSD.ORG 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102232026.f1NKQaW82988@harmony.village.org>; from imp@harmony.village.org on Fri, Feb 23, 2001 at 01:26:36PM -0700 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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