diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-09-12 00:06:00 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-09-12 00:06:00 +0000 |
commit | a6acd23c5351d9b70251aaf25a8949b4c31bc11f (patch) | |
tree | 0bc4bb67030f7e0bcd918cd1bc80f9c1e57f4f94 /lld/ELF/ScriptParser.cpp | |
parent | 661e2422d73ad2afb9deff3106cab401a6d44dc8 (diff) | |
download | bcm5719-llvm-a6acd23c5351d9b70251aaf25a8949b4c31bc11f.tar.gz bcm5719-llvm-a6acd23c5351d9b70251aaf25a8949b4c31bc11f.zip |
Align addresses, not offsets.
This fixes two more cases where we were aligning the offset in a
section, instead of the final address.
llvm-svn: 312983
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 6a534e60cba..7d01bac1f39 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -147,13 +147,11 @@ static void moveAbsRight(ExprValue &A, ExprValue &B) { static ExprValue add(ExprValue A, ExprValue B) { moveAbsRight(A, B); - uint64_t Val = alignTo(A.Val, A.Alignment) + B.getValue(); - return {A.Sec, A.ForceAbsolute, Val, A.Loc}; + return {A.Sec, A.ForceAbsolute, A.getSectionOffset() + B.getValue(), A.Loc}; } static ExprValue sub(ExprValue A, ExprValue B) { - uint64_t Val = alignTo(A.Val, A.Alignment) - B.getValue(); - return {A.Sec, Val, A.Loc}; + return {A.Sec, A.getSectionOffset() - B.getValue(), A.Loc}; } static ExprValue mul(ExprValue A, ExprValue B) { |