Re: binutils problem? WAS [Re: static linking error: ELF binary type "0" not known. Exec format error. Binary file not executable.]

From: Anton Shterenlikht <mexas_at_bristol.ac.uk>
Date: Mon, 6 Dec 2010 15:15:30 +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
Received on Mon Dec 06 2010 - 14:15:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:09 UTC