"Ulrich Drepper, ELF Handling For Thread-Local Storage" (5.5 x86-x64 linker optimizations, http://www.akkadia.org/drepper/tls.pdf) shows how GD can be optimized to IE.
This patch implements this optimization.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
ELF/OutputSections.cpp | ||
---|---|---|
226–231 ↗ | (On Diff #41192) | There is really a concerning trend that this function gets longer and longer over time. Probably it's time to split up into multiple small functions with comments. |
ELF/OutputSections.cpp | ||
---|---|---|
221–226 ↗ | (On Diff #41622) | Can you reduce the nest level by moving this if outside of the outer `if? I mean if (Body && Target->isTlsOptimized(Type, Body)) { P->setSymbolAndType(Body->getDynamicSymbolTableIndex(), Target->getTlsGotReloc(), Config->Mips64EL); P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body); return true; } if (Body && Target->isTlsGlobalDynamicReloc(Type)) { ... } |
ELF/Target.cpp | ||
494–495 ↗ | (On Diff #41622) | I don't think these magic numbers are good. In fact it seems that you don't need them. Please see the comment below. |
624 ↗ | (On Diff #41622) | This can be if (canBePreempted(&S, true)) |