[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/15149] New: Weak reference leads to DT_NEEDED entry
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/15149] New: Weak reference leads to DT_NEEDED entry |
Date: |
Thu, 14 Feb 2013 19:22:25 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15149
Bug #: 15149
Summary: Weak reference leads to DT_NEEDED entry
Product: binutils
Version: 2.24 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: address@hidden
ReportedBy: address@hidden
Classification: Unclassified
address@hidden xxx]$ cat foo.c
extern void bar (void);
int main()
{
bar ();
return 0;
}
address@hidden xxx]$ cat bar.c
extern int xxx __attribute__((weak));
int
bar (void)
{
return xxx;
}
address@hidden xxx]$ cat xxx.c
int xxx = 3;
address@hidden xxx]$ cat yyy.c
address@hidden xxx]$ make
gcc -Wl,--no-copy-dt-needed-entries -c -o bar.o bar.c
gcc -Wl,--no-copy-dt-needed-entries -c -o foo.o foo.c
gcc -Wl,--no-copy-dt-needed-entries -shared -fPIC -o libxxx.so xxx.c
gcc -Wl,--no-copy-dt-needed-entries -shared -fPIC -o libyyy.so yyy.c libxxx.so
gcc -Wl,--no-copy-dt-needed-entries -o x bar.o foo.o libyyy.so
-Wl,-rpath-link,.
gcc -Wl,--no-copy-dt-needed-entries -fuse-ld=gold -o y bar.o foo.o libyyy.so
-Wl,-rpath-link,.
readelf -d x | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libyyy.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [libxxx.so]
readelf -d y | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libyyy.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
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.
- [Bug ld/15149] New: Weak reference leads to DT_NEEDED entry,
hjl.tools at gmail dot com <=