Add memory ORIGIN and LENGTH expression support
authorRui Ueyama <ruiu@google.com>
Tue, 9 May 2017 18:24:38 +0000 (18:24 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 9 May 2017 18:24:38 +0000 (18:24 +0000)
commit91b95b61f8b815e45ad6c3cdb1d35c70bb9e7bff
treeef2a8bc1ddef7132e9e58c04df4ecee47a31cd48
parent41ffc70484532c3cb2bb8110fe585aa7200ebee6
Add memory ORIGIN and LENGTH expression support

Adds support for the ORIGIN and LENGTH linker script built in functions.

  ORIGIN(memory) Return the origin of the memory region
  LENGTH(memory) Return the length of the memory region

Redo of D29775 for refactored linker script parsing.

Patch by Robert Clarke

Differential Revision: https://reviews.llvm.org/D32934

llvm-svn: 302564
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/symbol-memoryexpr.s [new file with mode: 0644]