This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Linkerscript: discard .interp section if we have custom PHDRS layout and PT_INTERP is not listed.
ClosedPublic

Authored by evgeny777 on Aug 15 2016, 4:57 AM.

Details

Reviewers
ruiu
Summary

Current version may allocate new PT_LOAD in this case, which wastes space in ELF image and breaks our product linking.

Diff Detail

Event Timeline

evgeny777 updated this revision to Diff 68018.Aug 15 2016, 4:57 AM
evgeny777 retitled this revision from to [ELF] Linkerscript: discard .interp section if we have custom PHDRS layout and PT_INTERP is not listed..
evgeny777 updated this object.
evgeny777 added a reviewer: ruiu.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
ruiu accepted this revision.Aug 15 2016, 10:53 AM
ruiu edited edge metadata.

LGTM

ELF/LinkerScript.cpp
489

Discard sounds like this function discards (or remove) an existing section from an output section list, so it's a bit confusing. I'd name needsInterpSection.

This revision is now accepted and ready to land.Aug 15 2016, 10:53 AM
evgeny777 added inline comments.Aug 15 2016, 11:52 PM
ELF/LinkerScript.cpp
489

I can't decide in whether we need .interp section or not. I can only tell if we do not need it. So I renamed to ignoreInterpSection

evgeny777 closed this revision.Aug 16 2016, 8:33 AM