Skip to content

Conversation

@smithp35
Copy link
Contributor

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

@smithp35
Copy link
Contributor Author

smithp35 commented Jan 9, 2025

I'm working on a rebase of this PR.

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 smithp35 force-pushed the renumber-pauth-relocs branch from 6b15b45 to 5ed7ee4 Compare January 9, 2025 17:26
| ELF 64 Code | Name | Operation | Comment |
+=============+========================================+========================================+==========================+
| 0x8110 | R\_AARCH64\_AUTH\_MOVW\_GOTOFF\_G0 | G(ENCD(GDAT(S))) - GOT | Set a MOV[NZ] immediate |
| 0x245 | R\_AARCH64\_AUTH\_MOVW\_GOTOFF\_G0 | G(ENCD(GDAT(S))) - GOT | Set a MOV[NZ] immediate |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much a nit, but for the sanity of people that cross reference aaelf64 and pauthabielf64 documentation, it'd be nice if the ELF code in this doc wasn't written in hex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally wrote it in hex as LLVM (only implementation of PAuthABI defines relocation numbers in hex so this made it easier to cross-check the implementation. Just thinking if it is worth writing both? For example 0x245 (581)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, sounds good to me.

Add a decimal representation of the relocation code alongside the
relocation code for easier cross-reference with AAELF64.

The PAuthABI uses hex for the relocation codes as the only
implementation LLVM uses hex in the relocation definitions. This
makes it easier to cross-reference. Adding the decimal in
parentheses satisfies both forms of cross-reference.
Copy link
Member

@stuij stuij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smithp35 smithp35 merged commit 05abf4f into ARM-software:main Jan 10, 2025
1 check passed
Copy link

@sallyarmneale sallyarmneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

OpenHarmonySCM-noreply pushed a commit to openharmony/third_party_llvm-project that referenced this pull request Jul 17, 2025
Apply change from the spec
ARM-software/abi-aa#300

Signed-off-by:baojingjing <baojingjing@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pauthabielf64] Move signed GOT relocs from private to public space

3 participants