[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/15153] New: gold fails to detect undefined symbol
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/15153] New: gold fails to detect undefined symbol |
Date: |
Sat, 16 Feb 2013 01:48:40 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15153
Bug #: 15153
Summary: gold fails to detect undefined symbol
Product: binutils
Version: 2.24 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
AssignedTo: address@hidden
ReportedBy: address@hidden
CC: address@hidden
Classification: Unclassified
gold fails to detect undefined symbol:
address@hidden xxx]$ cat foo.c
extern int xxx __attribute__((weak));
extern void bar ();
int
main ()
{
bar ();
return xxx;
}
address@hidden xxx]$ cat yyy.c
extern int xxx;
int
bar (void)
{
return xxx;
}
address@hidden xxx]$ make
gcc -Wl,--no-copy-dt-needed-entries -c -o foo.o foo.c
gcc -Wl,--no-copy-dt-needed-entries -shared -fPIC -o libyyy.so yyy.c
gcc -Wl,--no-copy-dt-needed-entries -fuse-ld=gold -B./
-Wl,--no-allow-shlib-undefined -o y foo.o libyyy.so -Wl,-rpath,.
./y
./y: symbol lookup error: ./libyyy.so: undefined symbol: xxx
make: *** [all] Error 127
address@hidden xxx]$
ld detects the error:
address@hidden xxx]$ make x
gcc -Wl,--no-copy-dt-needed-entries -B./ -Wl,--no-allow-shlib-undefined -o x
foo.o libyyy.so -Wl,-rpath,.
foo.o: In function `main':
foo.c:(.text+0x10): undefined reference to `xxx'
collect2: error: ld returned 1 exit status
make: *** [x] Error 1
address@hidden xxx]$
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug gold/15153] New: gold fails to detect undefined symbol,
hjl.tools at gmail dot com <=