Summary: | Can't link in Linux object files on FreeBSD | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | ld | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils, uberlord |
Priority: | P2 | ||
Version: | 2.19 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | Link all sparc64 objects too |
Description
H.J. Lu
2007-04-24 23:09:21 UTC
A patch is posted at http://sourceware.org/ml/binutils/2007-04/msg00330.html An updated patch is at http://sourceware.org/ml/binutils/2007-04/msg00331.html An updated patch is posted at http://sourceware.org/ml/binutils/2007-08/msg00462.html An updated patch for i386/FreeBSD is posted at http://sourceware.org/ml/binutils/2007-10/msg00215.html *** Bug 5179 has been marked as a duplicate of this bug. *** Created attachment 2043 [details]
Link all sparc64 objects too
We need this for FreeBSD/Sparc64 as well. Thanks!
A new patch is posted at http://sourceware.org/ml/binutils/2007-10/msg00240.html The current patch is at http://sourceware.org/ml/binutils/2007-10/msg00257.html We missed a case of linking Linux .o against FreeBSD .so: [hjl@gnu-6 weak-11]$ cat foo.c extern void xxxx () __attribute__((weak)); void _start(void) { if (&xxxx != 0) xxxx (); } [hjl@gnu-6 weak-11]$ cat bar.c void __attribute__((weak)) xxxx () { } [hjl@gnu-6 weak-11]$ make gcc -O2 -fno-asynchronous-unwind-tables -c -o foo.o foo.c gcc -O2 -fno-asynchronous-unwind-tables -fPIC -c -o bar.o bar.c ./ld -shared -o libbar.so bar.o ./ld -o foo foo.o libbar.so readelf -s foo | grep xxxx 1: 00000000004002a0 2 FUNC GLOBAL DEFAULT UND xxxx 15: 00000000004002a0 2 FUNC GLOBAL DEFAULT UND xxxx [hjl@gnu-6 weak-11]$ ./ld -V GNU ld (GNU Binutils) 2.18.50.20080715 Supported emulations: elf_x86_64_fbsd elf_i386_fbsd elf_x86_64 elf_i386 [hjl@gnu-6 weak-11]$ It should be readelf -s foo | grep xxxx 1: 00000000004002a0 2 FUNC WEAK DEFAULT UND xxxx 15: 00000000004002a0 2 FUNC WEAK DEFAULT UND xxxx A new patch is posted at http://sourceware.org/ml/binutils/2008-07/msg00207.html Patch was applied |