summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-03-17 13:45:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-03-17 13:45:36 +0000
commitf2115f04c8a152af8b3dbf069cd5cba5854841a5 (patch)
tree6957e7122c97b5684f46bf1e247327ff87e6a797 /lld/ELF/LinkerScript.cpp
parent8fe7aea52779ce328a2f07e7c8194048b736ca21 (diff)
downloadbcm5719-llvm-f2115f04c8a152af8b3dbf069cd5cba5854841a5.tar.gz
bcm5719-llvm-f2115f04c8a152af8b3dbf069cd5cba5854841a5.zip
Support non abs values in the rhs of +.
llvm-svn: 298088
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index b05d55492b9..7ca9b298347 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -60,6 +60,8 @@ uint64_t ExprValue::getValue() const {
}
static ExprValue add(ExprValue A, ExprValue B) {
+ if (A.isAbsolute())
+ std::swap(A, B);
return {A.Sec, A.ForceAbsolute, A.Val + B.getValue()};
}
static ExprValue sub(ExprValue A, ExprValue B) {
OpenPOWER on IntegriCloud