[PATCH] D50494: [LLD] Reserve memory in implicitly set LMARegions

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 9 00:28:51 PDT 2018


kschwarz created this revision.
kschwarz added reviewers: ruiu, grimar.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.

If an output section is loaded into an implicitly set LMARegion, we need to reserve space for it. Otherwise, the following output sections will use invalid region counters in their computation of offsets and assign bogus addresses.
The rules for assigning implicit LMARegions are documented here: https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html

Newer versions of ld.bfd have more complicated rules (https://sourceware.org/binutils/docs-2.30/ld/Output-Section-LMA.html#Output-Section-LMA)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50494

Files:
  ELF/LinkerScript.cpp
  test/ELF/linkerscript/Inputs/at10.s
  test/ELF/linkerscript/Inputs/at9.s
  test/ELF/linkerscript/at10.test
  test/ELF/linkerscript/at9.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50494.159864.patch
Type: text/x-patch
Size: 5114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180809/8ef526f2/attachment.bin>


More information about the llvm-commits mailing list