[ELF] Linkerscript: support assignment outside SECTIONS
authorPetr Hosek <phosek@chromium.org>
Thu, 18 Aug 2016 04:34:27 +0000 (04:34 +0000)
committerPetr Hosek <phosek@chromium.org>
Thu, 18 Aug 2016 04:34:27 +0000 (04:34 +0000)
commit0df80bef9631ae50cdb37e16956020b92dc6e38c
tree0453f48f695be0d5d4237bc684628e18ecd0e67f
parentc7c81fa197ba6d1671004519f544e0c061629a76
[ELF] Linkerscript: support assignment outside SECTIONS

We only support assignments inside SECTIONS, but this does not match
the behavior of GNU linker which also allows them outside SECTIONS.
The only restriction on assignments outside SECTIONS is that they
cannot reference . (they have to be absolute expressions).

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

llvm-svn: 279033
lld/ELF/LinkerScript.cpp
lld/test/ELF/invalid-linkerscript.test
lld/test/ELF/linkerscript/linkerscript-symbols.s