Refuse to add two non absolute symbols.
Since there is no way to produce the correct answer at runtime, it is
probably better to just err.
llvm-svn: 298094
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 7ca9b29..48e2911 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -62,6 +62,8 @@
static ExprValue add(ExprValue A, ExprValue B) {
if (A.isAbsolute())
std::swap(A, B);
+ if (!B.isAbsolute())
+ error("At least one side of the expression must be absolute");
return {A.Sec, A.ForceAbsolute, A.Val + B.getValue()};
}
static ExprValue sub(ExprValue A, ExprValue B) {