diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-02-07 17:38:02 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-02-07 17:38:02 -0500 |
| commit | 38aed5af8bdefd13a355fc0728c6ad57e5efa3ff (patch) | |
| tree | 79eb22695fd67db1bf3253a2b1ffe70a975342c8 /deps/lld/ELF/ScriptParser.cpp | |
| parent | aa043a633904b6685a201000a0ab2a62fc3bdb91 (diff) | |
| download | zig-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.cpp | 15 |
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; } } |
