This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/2251] Weak undefined symbol doesn't work properly with PIE
- From: "hjl at lucon dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 31 Jan 2006 19:17:11 -0000
- Subject: [Bug libc/2251] Weak undefined symbol doesn't work properly with PIE
- References: <20060131191328.2251.hjl@lucon.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From hjl at lucon dot org 2006-01-31 19:17 -------
Created an attachment (id=854)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=854&action=view)
A testcase
PIE built with the fixed linker, I got
gcc -B./ -c -fPIC -g bar.c
gcc -B./ -shared -o libbar.so bar.o #-z nocombreloc
gcc -B./ -c -fPIC -g foo.c
gcc -B./ -c -fPIC -g main.c
gcc -B./ -c -fPIC -g dummy.c
gcc -B./ -shared -o libdummy.so dummy.o #-z nocombreloc
gcc -B./ -pie -o pie foo.o main.o libdummy.so -Wl,-z,nocombreloc -Wl,-rpath,.
gcc -B./ -o exec foo.o main.o libdummy.so -Wl,-z,nocombreloc -Wl,-rpath,.
cp -af libbar.so libdummy.so
./exec
main
foo
PASSED
./pie
main
foo
FAILED
That is undefined weak symbol in PIE is resolved to a definition in
libdummy.so unlike the normal executable.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=2251
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.