https://sourceware.org/bugzilla/show_bug.cgi?id=24836
crusader.mike at gmail dot com changed:
What|Removed |Added
Summary|--as-needed leaves unused |--as-needed can leave
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #11 from crusader.mike at gmail dot com ---
> ... it would be possible ... a lot of work for little gain
Well, in my case (which I believe isn't very rare) majority of functionality is
locked in a few large static libs (of
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #9 from crusader.mike at gmail dot com ---
... about #6, running my binary with LD_DEBUG:
LD_DEBUG=bindings LD_BIND_NOW=1 ./procmon.e
produces curious output:
...
27438: binding file /usr/local/lib64/libxalan-c.so.111
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #8 from crusader.mike at gmail dot com ---
Alan, you are correct -- looks like garbage collection can remove symbol
references to the point that final binary no longer needs given DT_NEEDED
shared lib anymore. That is precisely
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #6 from crusader.mike at gmail dot com ---
Symbol table '.dynsym' contains 361 entries:
Num:Value Size TypeBind Vis Ndx Name
...
237: 00415bb033 FUNCWEAK DEFAULT 13
x
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #4 from crusader.mike at gmail dot com ---
Is this the reason for this behaviour?
$ readelf -s procmon.e | grep xalan
237: 00415bb033 FUNCWEAK DEFAULT 13
_ZN11xalanc_1_XalanVe
289: 00415bb0
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #3 from crusader.mike at gmail dot com ---
Maybe garbage collection (-Wl,--gc-sections) happens after effect of
"-Wl,--as-needed"?
--
You are receiving this mail because:
You are on the CC list f
https://sourceware.org/bugzilla/show_bug.cgi?id=24836
--- Comment #2 from crusader.mike at gmail dot com ---
Here is the output with "-Wl,-v":
collect2 version 8.2.1 20180905 (Red Hat 8.2.1-3)
/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld -plugin
/opt/rh/devtool
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: crusader.mike at gmail dot com
Target Milestone: ---
I have a binary that is linked like this:
/opt/rh/devtoolset-8/root/usr/bin/g++
-O3 -DNDEBUG -Wl,--gc-sections -s -Wl,--as-needed
-o procmon.e
-Wl,-rpath,/usr