diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 5f474999013..d2b6335fe61 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -295,9 +295,11 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, } if (!Body.isPreemptible()) return 1; - Out<ELFT>::Got->addEntry(Body); - Out<ELFT>::RelaDyn->addReloc( - {Target->TlsGotRel, DynamicReloc<ELFT>::Off_Got, false, &Body}); + if (!Body.isInGot()) { + Out<ELFT>::Got->addEntry(Body); + Out<ELFT>::RelaDyn->addReloc( + {Target->TlsGotRel, DynamicReloc<ELFT>::Off_Got, false, &Body}); + } return 2; } return 0; |