summaryrefslogtreecommitdiff
path: root/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-01-24 20:26:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-01-24 20:26:03 +0000
commita506d0d6a9a6c2745e058e35ad4c62d1ddc5f20e (patch)
tree1eabba27e7647f059f5df7d9ff1fe39e08acda74 /ELF/ScriptParser.cpp
parent97dd191f563d0b295e4abc86dc95a4f6276c6d8f (diff)
Diffstat (limited to 'ELF/ScriptParser.cpp')
-rw-r--r--ELF/ScriptParser.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/ELF/ScriptParser.cpp b/ELF/ScriptParser.cpp
index 4263944981f2d..e068beeee2629 100644
--- a/ELF/ScriptParser.cpp
+++ b/ELF/ScriptParser.cpp
@@ -709,6 +709,14 @@ OutputSection *ScriptParser::readOutputSectionDescription(StringRef OutSec) {
if (consume(">"))
Cmd->MemoryRegionName = next();
+ if (consume("AT")) {
+ expect(">");
+ Cmd->LMARegionName = next();
+ }
+
+ if (Cmd->LMAExpr && !Cmd->LMARegionName.empty())
+ error("section can't have both LMA and a load region");
+
Cmd->Phdrs = readOutputSectionPhdrs();
if (consume("="))
@@ -922,7 +930,10 @@ ByteCommand *ScriptParser::readByteCommand(StringRef Tok) {
StringRef ScriptParser::readParenLiteral() {
expect("(");
+ bool Orig = InExpr;
+ InExpr = false;
StringRef Tok = next();
+ InExpr = Orig;
expect(")");
return Tok;
}