-
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
[pauthabi64] Add Auth variants of TLSDESC generating GOT relocations #295
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
…ons (#113716) See specification ARM-software/abi-aa#295
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
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` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The range for ADRP is ±4GB [1], so I think that the check should be between -2^32 and 2^32, instead of 20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
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