This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
GNU hash-style compatibility problem on x86_64
- From: Greg Schafer <gschafer at zip dot com dot au>
- To: binutils at sourceware dot org
- Cc: "H.J. Lu" <hjl at lucon dot org>
- Date: Tue, 14 Aug 2007 17:22:31 +1000
- Subject: GNU hash-style compatibility problem on x86_64
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
Thanks
Greg
(yes, I could just use a newer binutils, or even cross compile, but that's
not the point)