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

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 04 Dec 2010 00:52:57 +0100
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.

Alternatively, we can shove a similar patch into the binutils port, but
I'm not sure how much the ports people will like that. :)

I think I will apply the same approach to my projects/binutils-2.17
branch (aimed at importing the last GPLv2 binutils version into head).
Having target names clearly defined as elfXX-archname-freebsd is much
easier to deal with.

Received on Fri Dec 03 2010 - 22:52:54 UTC

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