"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
Diff Detail
Event Timeline
ELF/OutputSections.cpp | ||
---|---|---|
226–231 | 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 | ||
---|---|---|
196–201 | 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 | ||
457–459 | I don't think these magic numbers are good. In fact it seems that you don't need them. Please see the comment below. | |
580 | This can be if (canBePreempted(&S, true)) |
Can you reduce the nest level by moving this if outside of the outer `if? I mean