summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 8bb704c5247..c5b198456cc 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -645,7 +645,9 @@ void ScriptParser::readPhdrs() {
PhdrCmd.HasPhdrs = true;
else if (Tok == "FLAGS") {
expect("(");
- next().getAsInteger(0, PhdrCmd.Flags);
+ // Passing 0 for the value of dot is a bit of a hack. It means that
+ // we accept expressions like ".|1".
+ PhdrCmd.Flags = readExpr()(0);
expect(")");
} else
setError("unexpected header attribute: " + Tok);
OpenPOWER on IntegriCloud