summaryrefslogtreecommitdiff
path: root/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-24 01:00:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-24 01:00:50 +0000
commit0d9ba4fe26725cacc7253fc3c72c4574f26bc099 (patch)
tree90c426d54188ca226b29aaf8a308bba364a73d1a /ELF/ScriptParser.cpp
parenteb1ff93d02b5f17b6b409e83c6d9be585f4a04b3 (diff)
Notes
Diffstat (limited to 'ELF/ScriptParser.cpp')
-rw-r--r--ELF/ScriptParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/ELF/ScriptParser.cpp b/ELF/ScriptParser.cpp
index d56500ae7dd8..c1176ccfa8d5 100644
--- a/ELF/ScriptParser.cpp
+++ b/ELF/ScriptParser.cpp
@@ -151,6 +151,8 @@ static ExprValue add(ExprValue A, ExprValue B) {
}
static ExprValue sub(ExprValue A, ExprValue B) {
+ if (!A.isAbsolute() && !B.isAbsolute())
+ return A.getValue() - B.getValue();
return {A.Sec, false, A.getSectionOffset() - B.getValue(), A.Loc};
}