This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GNU hash-style compatibility problem on x86_64
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Greg Schafer <gschafer at zip dot com dot au>
- Cc: binutils at sourceware dot org
- Date: Tue, 14 Aug 2007 05:47:47 -0700
- Subject: Re: GNU hash-style compatibility problem on x86_64
- References: <20070814072231.GA1370@eyo32.local>
On Tue, Aug 14, 2007 at 05:22:31PM +1000, Greg Schafer wrote:
> Hi,
>
> Host platform is current x86_64:
>
> HJL binutils-2.17.50.0.18
> gcc-4.2.1
> glibc-2.6.1 (glibc defaults to compiling with --hash-style=both)
>
> The problem strikes on this host when attempting to natively bootstrap an
> older toolchain (eg: with FSF binutils-2.17):
>
> $ echo 'main(){}' | stage1/xgcc -Bstage1/ -xc -o /dev/null -
> /lib64/libc.so.6: file not recognized: File format not recognized
> collect2: ld returned 1 exit status
>
> Essentially, the older ld chokes on the newer libc ie: the one compiled with
> --hash-style=both (it affects any dso with --hash-style=gnu actually).
>
> The weird thing is, it only happens on x86_64. I've tested the exact same
> scenario on x86 and ppc and those arches both work fine. Why should x86_64
> behave any differently here? This is all above my head so I would really
> appreciate your help in understanding the root cause.
>
> You should be able to easily reproduce this if your x86_64 host has a libc
> that was compiled with --hash-style=both (latest Fedora, Debian lenny etc),
> just build binutils-2.17 then try to link using its ld. Note: you might have
> to fiddle with gcc specs if your host gcc is hardwired for --hash-style=gnu
>
Well, it sounds like a bug in binutils 2.17. There are so many of them
and they have been fixed in the current binutils. I don't want to spend
time on it unless it is reproducible in the current binutils.
H.J.