summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-09-20 19:24:57 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-09-20 19:24:57 +0000
commit23be5e8d70d39129f16096c54db6ff7d12949b3f (patch)
tree3502259a34ccdda9b7535846fdab3ad075077b23 /lld/ELF/ScriptParser.cpp
parent4355c7c562806cd74341e2bfb448786c40852122 (diff)
downloadbcm5719-llvm-23be5e8d70d39129f16096c54db6ff7d12949b3f.tar.gz
bcm5719-llvm-23be5e8d70d39129f16096c54db6ff7d12949b3f.zip
Consider ForceAbsolute again in moveAbsRight.
This patch goes back to considering ForceAbsolute in moveAbsRight, but only if the second argument is not already absolute. With this we can handle "foo + ABSOLUTE(foo)" and "ABSOLUTE(foo) + foo". llvm-svn: 313800
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index e91825680a5..c1daa9a4df2 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -139,7 +139,7 @@ static bool isUnderSysroot(StringRef Path) {
// Some operations only support one non absolute value. Move the
// absolute one to the right hand side for convenience.
static void moveAbsRight(ExprValue &A, ExprValue &B) {
- if (A.Sec == nullptr)
+ if (A.Sec == nullptr || (A.ForceAbsolute && !B.isAbsolute()))
std::swap(A, B);
if (!B.isAbsolute())
error(A.Loc + ": at least one side of the expression must be absolute");
OpenPOWER on IntegriCloud