[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/4424] Can't link in Linux object files on FreeBSD
From: |
hjl dot tools at gmail dot com |
Subject: |
[Bug ld/4424] Can't link in Linux object files on FreeBSD |
Date: |
15 Jul 2008 17:22:55 -0000 |
------- Additional Comments From hjl dot tools at gmail dot com 2008-07-15
17:22 -------
We missed a case of linking Linux .o against FreeBSD .so:
address@hidden weak-11]$ cat foo.c
extern void xxxx () __attribute__((weak));
void _start(void)
{
if (&xxxx != 0)
xxxx ();
}
address@hidden weak-11]$ cat bar.c
void
__attribute__((weak))
xxxx ()
{
}
address@hidden 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
address@hidden 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
address@hidden 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
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://sourceware.org/bugzilla/show_bug.cgi?id=4424
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/4424] Can't link in Linux object files on FreeBSD,
hjl dot tools at gmail dot com <=