Hacker News new | past | comments | ask | show | jobs | submit login

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.



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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: