Package: binutils-gold
Version: 2.19.1-1
Severity: normal
See this simple example (with the old GNU ld):
$ cat a.c
#include <stdio.h>
void hello(void)
{
printf("hello\n");
}
$ cat b.c
void hello(void);
void say_hello(void)
{
hello();
}
$ cat c.c
void say_hello(void);
int main()
{
say_hello();
return 0;
}
$ gcc -fPIC -shared -o liba.so a.c
$ gcc -fPIC -shared -L. -la -o liba.so a.c
$ LD_LIBRARY_PATH=. gcc -lb -L. -o c c.c
$ LD_LIBRARY_PATH=. ./c
hello
Now when using gold, it fails to link the "c" program because it can't find the
reference to 'hello', found in liba.so:
$ gcc -fPIC -shared -o liba.so a.c
$ gcc -fPIC -shared -L. -la -o liba.so a.c
$ LD_LIBRARY_PATH=. gcc -lb -L. -o c c.c
/usr/bin/ld: ./libb.so: undefined reference to 'hello'
collect2: ld returned 1 exit status
Thanks.
Upstream bug: http://sourceware.org/bugzilla/show_bug.cgi?id=10125
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (990, 'unstable'), (99, 'experimental'), (50, 'testing'), (9,
'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.29.1
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages binutils-gold depends on:
ii binutils 2.19.1-1 The GNU assembler, linker and bina
ii libc6 2.9-9 GNU C Library: Shared libraries
ii libgcc1 1:4.4.0-1 GCC support library
ii libstdc++6 4.4.0-1 The GNU Standard C++ Library v3
ii zlib1g 1:1.2.3.3.dfsg-13 compression library - runtime
binutils-gold recommends no packages.
binutils-gold suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]