[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/11548] -Bdynamic and --as-needed don't work together
From: |
hjl dot tools at gmail dot com |
Subject: |
[Bug ld/11548] -Bdynamic and --as-needed don't work together |
Date: |
27 Apr 2010 19:03:07 -0000 |
------- Additional Comments From hjl dot tools at gmail dot com 2010-04-27
19:03 -------
Created an attachment (id=4755)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4755&action=view)
A testcase
address@hidden needed-7]$ make
gcc -B./ -O -c -o main.o main.c
gcc -B./ -O -fPIC -c -o bar.o bar.c
gcc -B./ -shared -o libbar.so bar.o
gcc -B./ -o main1 main.o --Wl,-Bdynamic,--as-needed libbar.so
-Wl,--no-as-needed -Wl,-rpath,.
gcc -B./ -o main2 main.o -Wl,--as-needed,-Bdynamic libbar.so -Wl,--no-as-needed
-Wl,-rpath,.
gcc -B./ -o main3 main.o -Wl,--as-needed libbar.so -Wl,--no-as-needed
-Wl,-rpath,.
ldd ./main1
linux-vdso.so.1 => (0x00007fffca5ff000)
libbar.so => ./libbar.so (0x00007fafdf142000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d5a200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d59e00000)
./main1
Hello
ldd ./main2
linux-vdso.so.1 => (0x00007fff45747000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d5a200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d59e00000)
./main2
Hello
ldd ./main3
linux-vdso.so.1 => (0x00007fff2772a000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d5a200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d59e00000)
./main3
Hello
address@hidden needed-7]$
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11548
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.