summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index e8fbc2ce621..8ba203fa469 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -253,12 +253,13 @@ static bool handleTlsRelocation(unsigned Type, SymbolBody *Body,
return false;
if (Target->isTlsGlobalDynamicRel(Type)) {
- if (!Target->canRelaxTls(Type, Body) &&
- Out<ELFT>::Got->addDynTlsEntry(Body)) {
- Out<ELFT>::RelaDyn->addReloc(
- {Target->TlsModuleIndexRel, DynamicReloc<ELFT>::Off_GTlsIndex, Body});
- Out<ELFT>::RelaDyn->addReloc(
- {Target->TlsOffsetRel, DynamicReloc<ELFT>::Off_GTlsOffset, Body});
+ if (!Target->canRelaxTls(Type, Body)) {
+ if (Out<ELFT>::Got->addDynTlsEntry(Body)) {
+ Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel,
+ DynamicReloc<ELFT>::Off_GTlsIndex, Body});
+ Out<ELFT>::RelaDyn->addReloc(
+ {Target->TlsOffsetRel, DynamicReloc<ELFT>::Off_GTlsOffset, Body});
+ }
return true;
}
if (!canBePreempted(Body, true))
OpenPOWER on IntegriCloud