[PATCH] D36986: [ELF] Handle assignments outside SECTIONS command separately

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 16:01:16 PDT 2017


phosek created this revision.
phosek added a project: lld.
Herald added a subscriber: emaste.

The problem with assignments outside SECTIONS command is that they can
refer to synthetic symbols such as end, etext or edata. The value of
these symbols is fixed only after all linker script commands are
processed, so these assignments will be using non-final and hence
invalid value. We cannot postpone the processing of other linker script
commands since those will affect layout which in turn may affect the
value of the synthetic symbols. This change instead splits the
processing of assignments withing and outside SECTIONS command and
processes them separately which addresses this issue.


Repository:
  rL LLVM

https://reviews.llvm.org/D36986

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/ScriptParser.cpp
  ELF/Writer.cpp
  test/ELF/linkerscript/symbol-reserved.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36986.112083.patch
Type: text/x-patch
Size: 4178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170821/b126aee5/attachment.bin>


More information about the llvm-commits mailing list