This is the same problem as 127176e59eb9, but for static TLS rather than
dynamic TLS. Although we know the symbol will be the one in our own TLS
segment, and thus the offset of it within that, we don't know where in
the static TLS block our data will be allocated and thus we must emit a
dynamic relocation for this case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/ELF/SyntheticSections.cpp | ||
---|---|---|
1004 | (Caveat: I know really little/nothing about mips) if (s->isPreemptible || config->shared)? For other targets, -pie don't need a dynamic relocation. See bool isLocalInExecutable = !sym.isPreemptible && !config->shared; |
lld/ELF/SyntheticSections.cpp | ||
---|---|---|
1004 | Ah that's a good point, in my head I had BFD's definition of isPic here which is our shared. This seems like a systematic inefficiency in the TLS code here (of course, isPic _is_ normally right for the GOT, just not TLS...). |
Thanks! I feel like the mips TLS tests can be better organized. Many other targets use different files for LE/IE/LD/GD, which can usually improve clarity, but that is not your obligation to do it....
Yeah, updating these was a painful experience... so I won't complain if someone feels motivated to split them out :)
(Caveat: I know really little/nothing about mips)
if (s->isPreemptible || config->shared)?
For other targets, -pie don't need a dynamic relocation. See bool isLocalInExecutable = !sym.isPreemptible && !config->shared;