[pauthabi64] Add Auth variants of TLSDESC generating GOT relocations#295
Merged
smithp35 merged 2 commits intoARM-software:mainfrom Jan 9, 2025
Merged
[pauthabi64] Add Auth variants of TLSDESC generating GOT relocations#295smithp35 merged 2 commits intoARM-software:mainfrom
smithp35 merged 2 commits intoARM-software:mainfrom
Conversation
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
kovdan01
added a commit
to llvm/llvm-project
that referenced
this pull request
Nov 18, 2024
…ons (#113716) See specification ARM-software/abi-aa#295
smithp35
added a commit
to smithp35/abi-aa
that referenced
this pull request
Nov 29, 2024
In the initial draft relocations for signing GOT entries were defined in the private space reserved for experiments. It was not known if these relocations would be useful as if RELRO is supported the GOT does not need to be signed. There is now at least one user of the GOT signing relocations so we should move the relocations out of the private space and into the space reserved for the PAuthABI. This PR includes relocations added in ARM-software#295 Fixes: ARM-software#298
stuij
reviewed
Jan 9, 2025
pauthabielf64/pauthabielf64.rst
Outdated
| +-------------+----------------------------------------+----------------------------------------+--------------------------+ | ||
| | 0x811E | R\_AARCH64\_AUTH\_TLSDESC\_ADR\_PAGE21 | Page(G(ENCD(GTLSDESC(S)))) - Page(P) | Set an ADRP immediate | | ||
| | | | | field to bits [32:12] of | | ||
| | | | | X; check –2\ :sup:`20` | |
Member
There was a problem hiding this comment.
The range for ADRP is ±4GB [1], so I think that the check should be between -2^32 and 2^32, instead of 20.
Contributor
Author
There was a problem hiding this comment.
ACK. It looks like I used the text from R_<CLS>_TLSDESC_ ADR_PREL21 in the table rather than the similarly named R_<CLS>_TLSDESC_ ADR_PAGE21
Will fix.
Contributor
Author
There was a problem hiding this comment.
I've updated the PR to use -2^32 and 2^32
The R_AARCH64_AUTH_TLSDESC_ADR_PAGE21 now has the correct range check of +- 2^32.
smithp35
added a commit
to smithp35/abi-aa
that referenced
this pull request
Jan 9, 2025
In the initial draft relocations for signing GOT entries were defined in the private space reserved for experiments. It was not known if these relocations would be useful as if RELRO is supported the GOT does not need to be signed. There is now at least one user of the GOT signing relocations so we should move the relocations out of the private space and into the space reserved for the PAuthABI. This PR includes relocations added in ARM-software#295 Fixes: ARM-software#298
smithp35
added a commit
that referenced
this pull request
Jan 10, 2025
In the initial draft relocations for signing GOT entries were defined in the private space reserved for experiments. It was not known if these relocations would be useful as if RELRO is supported the GOT does not need to be signed. There is now at least one user of the GOT signing relocations so we should move the relocations out of the private space and into the space reserved for the PAuthABI. This PR includes relocations added in #295 Fixes: #298
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add static Auth equivalents of the existing relocations:
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 #293