4 ms·
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 lev
by yakubin 6y ago
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.
- floatboth 6y agoYou 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.