Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
ELF/Relocations.cpp | ||
---|---|---|
160 ↗ | (On Diff #94342) | 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 ↗ | (On Diff #94500) | Why do you need this? |
1845–1847 ↗ | (On Diff #94500) | This is not a comment to this particular patch, but we need to remove this piece of code and instead create a way to just set "1" to .got without using this type of relocation in an odd way. |
ELF/Target.cpp | ||
---|---|---|
1842 ↗ | (On Diff #94500) | 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 ↗ | (On Diff #94500) | 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 ↗ | (On Diff #94500) | 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. |