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.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index af1f43be832..5d589d747f0 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -219,14 +219,15 @@ void Writer<ELFT>::scanRelocs(
Body = Body->repl();
if (Body && Body->isTLS() && Target->isTlsGlobalDynamicReloc(Type)) {
- if (Target->isTlsOptimized(Type, Body))
- continue;
- if (Out<ELFT>::Got->addDynTlsEntry(Body)) {
+ bool Opt = Target->isTlsOptimized(Type, Body);
+ if (!Opt && Out<ELFT>::Got->addDynTlsEntry(Body)) {
Out<ELFT>::RelaDyn->addReloc({&C, &RI});
Out<ELFT>::RelaDyn->addReloc({nullptr, nullptr});
Body->setUsedInDynamicReloc();
+ continue;
}
- continue;
+ if (!canBePreempted(Body, true))
+ continue;
}
if (Body && Body->isTLS() && !Target->isTlsDynReloc(Type))
OpenPOWER on IntegriCloud