https://sourceware.org/bugzilla/show_bug.cgi?id=25593
Bug ID: 25593 Summary: --as-needed breaks DT_NEEDED order with linker plugin Product: binutils Version: 2.33 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- echo 'void foo() {}' > libt.c echo 'void foo(); int main() { foo(); }' > t.c gcc -o libt.so -shared libt.c -Wl,-soname,libt.so -fPIC -flto gcc -c t.c -flto gcc -Wl,--as-needed t.o libt.so readelf -d a.out | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [libt.so] but libc has to come last so the program can use RTLD_NEXT to arrive at symbols from libc. Works fine with gold. -- You are receiving this mail because: You are on the CC list for the bug.