[PATCH] D10952: [LinkerScript] Don't create unnecessarily large segments

Rafael Auler rafaelauler at gmail.com
Sun Jul 5 22:38:42 PDT 2015


rafaelauler created this revision.
rafaelauler added reviewers: shankar.easwaran, denis-protivensky.
rafaelauler added a subscriber: llvm-commits.

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.

http://reviews.llvm.org/D10952

Files:
  lib/ReaderWriter/ELF/SegmentChunks.cpp
  test/elf/linkerscript/sections-order.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10952.29063.patch
Type: text/x-patch
Size: 6108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150706/38754c53/attachment.bin>


More information about the llvm-commits mailing list