From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 10 07:45:49 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69B4F16A4CE for ; Tue, 10 Feb 2004 07:45:49 -0800 (PST) Received: from vorag.quic.net (vorag.quic.net [69.10.147.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D40943D1D for ; Tue, 10 Feb 2004 07:45:49 -0800 (PST) (envelope-from utsl@quic.net) Received: from quic.net (vorag.quic.net [69.10.147.214]) by vorag.quic.net (Postfix) with SMTP id 1E06A81CA; Tue, 10 Feb 2004 10:45:53 -0500 (EST) Received: (nullmailer pid 31157 invoked by uid 1032); Tue, 10 Feb 2004 15:45:53 -0000 Date: Tue, 10 Feb 2004 10:45:53 -0500 From: Nathan Hawkins To: Philip Reynolds Message-ID: <20040210154553.GB69038@quic.net> References: <20040205083945.GB96509@rfc-networks.ie> <20040205095636.GF13932@FreeBSD.org.ua> <20040205103154.GA99852@rfc-networks.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040205103154.GA99852@rfc-networks.ie> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org Subject: Re: ELF branding / magic numbers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 15:45:49 -0000 On Thu, Feb 05, 2004 at 10:31:54AM +0000, Philip Reynolds wrote: > Ruslan Ermilov 35 lines of wisdom included: > > On Thu, Feb 05, 2004 at 08:39:45AM +0000, Philip Reynolds wrote: > > [...] > > > Does the magic number not then support multiple ABI's per system > > > architecture, or is there some part of the puzzle I'm missing? > > > > > There's an EI_ABIVERSION byte following the EI_OSABI byte, which > > is both documented in the elf(5) manpage, and is shown in the > > ``readelf -h'' output. > > You misunderstood me. > > My question was why is there a need for a PT_NOTE section (which is > a more convaluted way of branding and reading a brand of an elf > binary) if the above sections exist? Yes. It is used on other systems, like NetBSD and Linux. Having the note section allows those system to correctly recognize FreeBSD binaries. (The people developing binutils apparently don't agree with the use of EI_OSABI.) Unfortunately, FreeBSD doesn't check for it in the kernel. Doing it as a fall-back would permit detecting statically linked Linux binaries, without needing to run brandelf on them. I've been considering working on a patch for that, but haven't had time. ---Nathan