diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-01-12 09:07:35 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-01-12 09:07:35 +0000 |
commit | 5d01a8be96c92fa59b51812597d7c3e10139bc76 (patch) | |
tree | e9ebc437bf0709cd8192d8adcbbb23eca84e7898 /lld/ELF/ScriptParser.cpp | |
parent | 76a1de3cd5c0eb0d9f7c025f517d664e0d60267f (diff) | |
download | bcm5719-llvm-5d01a8be96c92fa59b51812597d7c3e10139bc76.tar.gz bcm5719-llvm-5d01a8be96c92fa59b51812597d7c3e10139bc76.zip |
[ELF] - Fix for ld.lld does not accept "AT" syntax for declaring LMA region
AT> lma_region expression allows to specify the memory region
for section load address.
Should fix PR35684.
Differential revision: https://reviews.llvm.org/D41397
llvm-svn: 322359
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 4263944981f..435b3b28f4f 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/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("=")) |