summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 6c0bd5259b0..2c58be39d7a 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -169,11 +169,14 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd,
}
if (Target->isTlsOptimized(Type, &Body)) {
+ uintX_t SymVA = Target->relocNeedsGot(Type, Body)
+ ? Out<ELFT>::Got->getEntryAddr(Body)
+ : getSymVA<ELFT>(Body);
// By optimizing TLS relocations, it is sometimes needed to skip
// relocations that immediately follow TLS relocations. This function
// knows how many slots we need to skip.
- I += Target->relocateTlsOptimize(BufLoc, BufEnd, Type, AddrLoc,
- getSymVA<ELFT>(Body));
+ I += Target->relocateTlsOptimize(BufLoc, BufEnd, Type, AddrLoc, SymVA,
+ Body);
continue;
}
OpenPOWER on IntegriCloud