This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Use gc-sections by default
ClosedPublic

Authored by cryptoad on Mar 5 2018, 3:28 PM.

Details

Summary

If not using -Wl,--gc-sections, a whole lot of unused sanitizer_common code
and related static variables are pulled into the shared library.
Keep the binary size smaller, and its memory footprint smaller as well, by
using the compiler flags -ffunction-section & -fdata-sections by default,
as well as the linker flags -Wl,--gc-sections.

Current experiments show a large discrepency between binary sizes generated
by gcc (big) and clang (small). I am not sure yet how I can make a test that
would encompass both, so it's an outstanding work item.

Diff Detail

Event Timeline

cryptoad created this revision.Mar 5 2018, 3:28 PM
Herald added subscribers: Restricted Project, delcypher, mgorny. · View Herald TranscriptMar 5 2018, 3:28 PM
alekseyshl accepted this revision.Mar 6 2018, 11:36 AM
This revision is now accepted and ready to land.Mar 6 2018, 11:36 AM
This revision was automatically updated to reflect the committed changes.