summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 783d20c2025..741b32ff031 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -1154,6 +1154,7 @@ Expr ScriptParser::readPrimary() {
if (Tok == "ADDR") {
StringRef Name = readParenLiteral();
OutputSection *Sec = Script->getOrCreateOutputSection(Name);
+ Sec->UsedInExpression = true;
return [=]() -> ExprValue {
checkIfExists(Sec, Location);
return {Sec, false, 0, Location};
@@ -1230,6 +1231,7 @@ Expr ScriptParser::readPrimary() {
if (Tok == "LOADADDR") {
StringRef Name = readParenLiteral();
OutputSection *Cmd = Script->getOrCreateOutputSection(Name);
+ Cmd->UsedInExpression = true;
return [=] {
checkIfExists(Cmd, Location);
return Cmd->getLMA();
OpenPOWER on IntegriCloud