This is an archive of the discontinued LLVM Phabricator instance.

[LinkerScript] Don't create unnecessarily large segments
ClosedPublic

Authored by rafaelauler on Jul 5 2015, 10:38 PM.

Details

Summary

When using a linker script expression to change the address of a section, even
if the new address is more than a page of distance from the old address, lld
may put everything in the same segment, forcing it to be unnecessarily large.
This patch changes the logic in Segment::assignVirtualAddress() and
Segment::assignFileOffsets() to allow the segment to be sliced into two or more
if it detects a linker script expression that changes a section address.

Diff Detail

Repository
rL LLVM

Event Timeline

rafaelauler retitled this revision from to [LinkerScript] Don't create unnecessarily large segments.
rafaelauler updated this object.
rafaelauler added a subscriber: llvm-commits.
denis-protivensky accepted this revision.Jul 6 2015, 5:25 AM
denis-protivensky edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 6 2015, 5:25 AM
This revision was automatically updated to reflect the committed changes.