bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24836] --as-needed leaves unused direct dependencies


From: crusader.mike at gmail dot com
Subject: [Bug ld/24836] --as-needed leaves unused direct dependencies
Date: Tue, 30 Jul 2019 17:02:38 +0000

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 dubious quality) and all minor tools link
them and (due to various effects) end up having dummy dependencies, forcing me
to package unnecessary libs in deliverables (plus some waste at runtime).
Fixing this is not huge, but nice to have.

In terms of work -- what about associating a counter with every lib, which goes
up for every resolved symbol and goes down for every symbol marked for garbage
collection? At the end -- remove all DT_NEEDED entries with counter at 0. Well,
(since I am ignorant wrt ld implementation) it is probably a dumb idea, so I
'll leave this problem with those who know what they are doing.


> ... to do better than just removing DT_NEEDED entries would basically require 
> iterating the link
What do you mean by "to do better"?


> ... that should help explain the various destructor ...
Thank you, Alan. Now it makes sense.


Can you comment on #7? I.e. why elf executable ends up having large .dynsym
table? is there a way to to trim it down only to stuff used by it's shared
libs? Thank you.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]