[ELF] - SEGMENT_START's default argument can be an expression
Our implementation supported integer value previously.
ld can use expression,
for example, it is OK to write
. = SEGMENT_START("foobar", .);
Patch implements that.
llvm-svn: 281831
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index d6f406e..597d3ba 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1427,11 +1427,9 @@
expect("(");
next();
expect(",");
- uint64_t Val;
- if (next().getAsInteger(0, Val))
- setError("integer expected");
+ Expr E = readExpr();
expect(")");
- return [=](uint64_t Dot) { return Val; };
+ return [=](uint64_t Dot) { return E(Dot); };
}
if (Tok == "DATA_SEGMENT_ALIGN") {
expect("(");