https://sourceware.org/bugzilla/show_bug.cgi?id=27441
Alan Modra <amodra at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at sourceware dot org |amodra at gmail dot com --- Comment #8 from Alan Modra <amodra at gmail dot com> --- (In reply to Michael Matz from comment #3) > % gcc -fPIC -Wl,--as-needed -fno-lto -shared -o good.so bad4.c -L. -l2 -l1 > % readelf-dW good.so | grep lib > 0x0000000000000001 (NEEDED) Shared library: [lib2.so] > 0x0000000000000001 (NEEDED) Shared library: [lib1.so] I'd actually like to fix the above to *not* have DT_NEEDED lib2.so. The reason is that as-needed was supposed to be modeled on the way archive entries are treated, and if you were using static libraries you'd find the weak func1 in lib2.a would not be enough to cause lib2.o to be extracted.. Unfortunately I can't do that, libm.so.6 for instance is full of weak dynamic symbols. So for as-needed shared libraries we instead say the library is needed whenever a non-weak undefined reference is satisfied by the library regardless of whether the definition is strong or weak. I guess I need to do the same for plugins. -- You are receiving this mail because: You are on the CC list for the bug.