From 38aed5af8bdefd13a355fc0728c6ad57e5efa3ff Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 7 Feb 2018 17:38:02 -0500 Subject: update embedded LLD to 6.0.0rc2 --- deps/lld/ELF/ScriptParser.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'deps/lld/ELF/ScriptParser.cpp') 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(); - *MR = {Name, Origin, Length, Flags, NegFlags}; + MemoryRegion *MR = + make(Name, Origin, Length, Flags, NegFlags); Script->MemoryRegions[Name] = MR; } } -- cgit v1.2.3