From owner-freebsd-current@FreeBSD.ORG Mon Dec 6 15:15:37 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E38106564A for ; Mon, 6 Dec 2010 15:15:37 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 870568FC0A for ; Mon, 6 Dec 2010 15:15:37 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1PPcmt-00020O-Pj; Mon, 06 Dec 2010 15:15:36 +0000 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1PPcmt-0007ZA-KK; Mon, 06 Dec 2010 15:15:35 +0000 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id oB6FFZZm055435; Mon, 6 Dec 2010 15:15:35 GMT (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id oB6FFZVS055434; Mon, 6 Dec 2010 15:15:35 GMT (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Mon, 6 Dec 2010 15:15:30 +0000 From: Anton Shterenlikht To: Dimitry Andric Message-ID: <20101206151530.GA55368@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: Dimitry Andric , freebsd-current@freebsd.org, Marcel Moolenaar References: <20101203095831.GA5468@mech-cluster241.men.bris.ac.uk> <4CF982D9.7070602@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CF982D9.7070602@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org, Marcel Moolenaar Subject: Re: binutils problem? WAS [Re: static linking error: ELF binary type "0" not known. Exec format error. Binary file not executable.] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 15:15:37 -0000 On Sat, Dec 04, 2010 at 12:52:57AM +0100, Dimitry Andric wrote: > On 2010-12-03 10:58, Anton Shterenlikht wrote: > >>>a.out: ELF 64-bit LSB executable, IA-64, version 1 (SYSV), statically > >>>linked, not stripped > ... > >>The branding on ia64 is wrong. The executable is not marked as being > >>a FreeBSD executable. It's declared as SYSV, whereas on amd64 it's > >>properly declared as FreeBSD. > >> > >>This is a binutils problem. > ... > >Anybody here can explain better what Marcel means > >by "binutils problem", and how to fix it? > > > >I've binutils-2.20.1_3 installed from devel/binutils. > > The problem is that our base binutils's BFD library has a custom hack to > 'brand' the produced executables, e.g. set the ELF_OSABI field in the > ELF header to ELFOSABI_FREEBSD. > > Other arches such as i386, amd64 (x86_64 in binutils land), sparc and > even alpha (!) have had patches sent upstream to do the right thing for > FreeBSD, but not ia64. > > If you can, please try the attached patch, which resolves the problem on > the ia64 machine I have tried it on. It should really be sent upstream > to the binutils people, if there is some interest. Could there be a problem in the patch?: % pwd /usr/src/contrib/binutils/bfd % patch < binutils-ia64-freebsd.diff Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/bfd/config.bfd b/bfd/config.bfd |index 9b719d8..d2fe23e 100644 |--- a/bfd/config.bfd |+++ b/bfd/config.bfd -------------------------- Patching file config.bfd using Plan A... Hunk #1 failed at 182. 1 out of 1 hunks failed--saving rejects to config.bfd.rej Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/bfd/configure b/bfd/configure |index 278cc1d..ad9dcc9 100755 |--- a/bfd/configure |+++ b/bfd/configure -------------------------- Patching file configure using Plan A... Hunk #1 succeeded at 6365 with fuzz 1 (offset -8804 lines). Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c |index d42ad89..5625c44 100644 |--- a/bfd/elfxx-ia64.c |+++ b/bfd/elfxx-ia64.c -------------------------- Patching file elfxx-ia64.c using Plan A... Hunk #1 succeeded at 5013 (offset -1064 lines). Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/bfd/targets.c b/bfd/targets.c |index 3e99754..a642a8d 100644 |--- a/bfd/targets.c |+++ b/bfd/targets.c -------------------------- Patching file targets.c using Plan A... Hunk #1 succeeded at 595 with fuzz 1 (offset -102 lines). Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/ld/emulparams/elf64_ia64_fbsd.sh b/ld/emulparams/elf64_ia64_fbsd.sh |index ab7e78f..a7e2675 100644 |--- a/ld/emulparams/elf64_ia64_fbsd.sh |+++ b/ld/emulparams/elf64_ia64_fbsd.sh -------------------------- File to patch: ../ld/emulparams/elf64_ia64_fbsd.sh Patching file ../ld/emulparams/elf64_ia64_fbsd.sh using Plan A... Hunk #1 succeeded at 4 with fuzz 2. patch: **** misordered hunks! output would be garbled % many thanks for your help anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423