summaryrefslogtreecommitdiff
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index e95cca993bec..2dc263d12f08 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -1564,9 +1564,11 @@ int64_t DynamicReloc::computeAddend() const {
assert(sym != nullptr);
return addend;
case AddendOnlyWithTargetVA:
- case AgainstSymbolWithTargetVA:
- return InputSection::getRelocTargetVA(inputSec->file, type, addend,
- getOffset(), *sym, expr);
+ case AgainstSymbolWithTargetVA: {
+ uint64_t ca = InputSection::getRelocTargetVA(inputSec->file, type, addend,
+ getOffset(), *sym, expr);
+ return config->is64 ? ca : SignExtend64<32>(ca);
+ }
case MipsMultiGotPage:
assert(sym == nullptr);
return getMipsPageAddr(outputSec->addr) + addend;