Details
Diff Detail
Event Timeline
ELF/Relocations.cpp | ||
---|---|---|
154 | Why Config->Pic? Is it not always 1 for position independent executables? |
Yes, we can use Config->Shared instead, thanks for pointing that out. I've updated to use Config->Shared and have put back the use of TlsOffsetRel in the Got, it could be possible to add another field to make it use a more regular relocation code, but I'm not sure that is a net win in readability. I'm happy to make the change if it is important to others though.
ELF/Target.cpp | ||
---|---|---|
1842 | It is so the same relocation code can be used in: AddTlsReloc(Off + Config->Wordsize, Target->TlsOffsetRel, &Body, NeedDynOff); Without it, it would need to be AddTlsReloc(Off + Config->Wordsize, NeedDynOff ? Target->TlsOffsetRel : R_ARM_ABS32, NeedDynOff); As when we statically come to resolve the R_ARM_TLS_DTPOFF32 we get unknown relocation code. I thought that the trade off in adding R_ARM_TLS_DTPOFF32 was worth it as it emphasized that the dynamic relocation was just being evaluated at static link time. I'm not hugely fussed about doing it this way. | |
1845–1847 | These possibilities come to mind:
I'd like if we have a solution that both you and Rafael are happy with. I have a weak preference for resolving the Relocation as 1 until there are other cases where we need to write arbitrary constants to the GotSection, but as I say this is a weak preference and I'm happy to change it. |
LGTM
ELF/Target.cpp | ||
---|---|---|
1842 | Got it. Thank you for explaining. I think I'm slightly inclined to go with R_ARM_ABS32, but because we already have TLS relocations here, I"m OK with the new code. |
Why Config->Pic? Is it not always 1 for position independent executables?