This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/2251] Weak undefined symbol doesn't work properly with PIE


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]