------- 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:

[EMAIL PROTECTED] weak-11]$ cat foo.c
extern void xxxx () __attribute__((weak));
void _start(void)
{ 
  if (&xxxx != 0)
    xxxx ();
}
[EMAIL PROTECTED] weak-11]$ cat bar.c
void
__attribute__((weak))
xxxx ()
{
}
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to