This is an archive of the discontinued LLVM Phabricator instance.

ELF: Do not create multiple thunks for the same virtual address.
ClosedPublic

Authored by pcc on Mar 8 2018, 6:19 PM.

Details

Summary

This avoids creating multiple thunks for symbols with aliases or which
belong to ICF'd sections. This patch reduces the size of Chromium for
Android by 260KB (0.8%).

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

pcc created this revision.Mar 8 2018, 6:19 PM
smeenai added a subscriber: smeenai.Mar 8 2018, 6:57 PM
ruiu accepted this revision.Mar 8 2018, 8:07 PM

LGTM

lld/ELF/Relocations.cpp
1243 ↗(On Diff #137686)

Please add a comment saying that we use (section, offset) pair to find thunk position if possible so that we create only one thunk for aliased symbols or ICFed sections.

This revision is now accepted and ready to land.Mar 8 2018, 8:07 PM

Thanks for the optimisation, LGTM too.

This revision was automatically updated to reflect the committed changes.