-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pauthabielf64] Define static AUTH TLSDESC relocations #293
Comments
@smithp35 I've submitted a PR to llvm-project repo adding the relocs with the following codes (the latest code for previously defined GOT-generating relocs was 0x811d) - see llvm/llvm-project#113716:
Please let me know if these code are OK. |
My apologies, I'll be out of office for the the week of 28th October to the 1st November so this is a quick response at the weekend. I'll get back to this when I'm back in the office in a week's time. The relocation codes are OK for now [1] as they are in the private space reserved for experiments https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#5714private-and-platform-specific-relocations The GOT signing relocations are currently in the private space. As I understand it there's a high chance that these will be needed. When they stabilise we'll need to move them to the space reserved for PAuthABI https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#5716pauthabi-relocations What I think needs doing:
There's a separate topic of moving the relocations from the private experiment space. |
@smithp35 Thanks for your feedback!
These three should be enough for working TLSDESC implementation - we have llvm codegen llvm/llvm-project#113813, lld linker llvm/llvm-project#113817 and musl dynamic loader access-softek/musl#2 patches for that, and the functionality was also tested in runtime, not only by lit tests. It actually looks like that other non-auth TLSDESC-related relocs from this section https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#57115thread-local-storage-descriptors are not even used by llvm-project. Some of them (
I've just added AUTH to the following non-auth reloc names:
I can submit a corresponding PR if you wish - just let me know if you want me to do that or if you plan to do it by yourself later. |
Just got back to the office today, apologies for the delay in responding. I can post a patch to the ABI tomorrow. Looking at the initial proposals for the relocation, the code sequences for the tiny and large code-models use these relocations. Although to the best of my knowledge both clang and GCC only implement the small code-model for accessing TLS. I agree that we don't need to specify relocations for these until someone wants to optimise TLSDESC for the tiny code-model. Tiny:
Large:
|
Add static Auth equivalents of the existing relocations: * R_AARCH64_TLSDESC_ADR_PAGE21 * R_AARCH64_TLSDESC_LD64_LO12 * R_AARCH64_TLSDESC_ADD_LO12 These are sufficient to implement the small code-model for TLSDESC using the PAuthABI. Support for the tiny and large code-model is not implemented for the PAuthABI, or for the normal ABI in both clang and GCC so we defer from specifiying Auth variants of all possible relocations. I've followed the convention that non-zero addends are not permitted for GOT generating relocations. As each unique S+A combination needs its own pair of GOT slots indexed by S+A and no static linker supports that. Fixes ARM-software#293
I've submitted #295 for review |
Add static Auth equivalents of the existing relocations: * R_AARCH64_TLSDESC_ADR_PAGE21 * R_AARCH64_TLSDESC_LD64_LO12 * R_AARCH64_TLSDESC_ADD_LO12 These are sufficient to implement the small code-model for TLSDESC using the PAuthABI. Support for the tiny and large code-model is not implemented for the PAuthABI, or for the normal ABI in both clang and GCC so we defer from specifiying Auth variants of all possible relocations. I've followed the convention that non-zero addends are not permitted for GOT generating relocations. As each unique S+A combination needs its own pair of GOT slots indexed by S+A and no static linker supports that. Fixes ARM-software#293
In pauthabielf64, dynamic AUTH TLSDESC relocation
R_AARCH64_AUTH_TLSDESC
is defined https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#auth-variant-got-generating-relocations.However, the section with AUTH variant GOT-generating relocations does not contain definitions for static TLSDESC relocs: https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#auth-variant-got-generating-relocations.
Particularly, the following relocation types are missing and should be defined:
R_AARCH64_AUTH_TLSDESC_ADR_PAGE21
R_AARCH64_AUTH_TLSDESC_LD64_LO12
R_AARCH64_AUTH_TLSDESC_ADD_LO12
The text was updated successfully, but these errors were encountered: