aboutsummaryrefslogtreecommitdiff
path: root/deps/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-07 17:38:02 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-07 17:38:02 -0500
commit38aed5af8bdefd13a355fc0728c6ad57e5efa3ff (patch)
tree79eb22695fd67db1bf3253a2b1ffe70a975342c8 /deps/lld/ELF/ScriptParser.cpp
parentaa043a633904b6685a201000a0ab2a62fc3bdb91 (diff)
downloadzig-38aed5af8bdefd13a355fc0728c6ad57e5efa3ff.tar.gz
zig-38aed5af8bdefd13a355fc0728c6ad57e5efa3ff.zip
update embedded LLD to 6.0.0rc2
Diffstat (limited to 'deps/lld/ELF/ScriptParser.cpp')
-rw-r--r--deps/lld/ELF/ScriptParser.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/deps/lld/ELF/ScriptParser.cpp b/deps/lld/ELF/ScriptParser.cpp
index 4263944981..3d2606db8d 100644
--- a/deps/lld/ELF/ScriptParser.cpp
+++ b/deps/lld/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;
}
@@ -1282,8 +1293,8 @@ void ScriptParser::readMemory() {
// Add the memory region to the region map.
if (Script->MemoryRegions.count(Name))
setError("region '" + Name + "' already defined");
- MemoryRegion *MR = make<MemoryRegion>();
- *MR = {Name, Origin, Length, Flags, NegFlags};
+ MemoryRegion *MR =
+ make<MemoryRegion>(Name, Origin, Length, Flags, NegFlags);
Script->MemoryRegions[Name] = MR;
}
}