Re:“Shared libraries are not a good thing in general”
by yakubin on Saturday May 01, 2021 @07:00PM
(#27010689)
Even without LTO, linker will discard object files that aren't used (on Linux a static library is just an AR archive of object files). It's just a different level of granularity.
[ Parent
| on HN ]
Re:“Shared libraries are not a good thing in general”
by floatboth on Saturday May 01, 2021 @08:28PM
(#27011243)
You can get better granularity – build with -ffunction-sections, link with --gc-sections.
LTO is really a much bigger deal, the main reason to use it is not throwing unused stuff away, but inlining across all the things.