From f2115f04c8a152af8b3dbf069cd5cba5854841a5 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 17 Mar 2017 13:45:36 +0000 Subject: Support non abs values in the rhs of +. llvm-svn: 298088 --- lld/ELF/LinkerScript.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lld/ELF/LinkerScript.cpp') 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) { -- cgit v1.2.3