Skip to content
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] Introduce R_AARCH64_AUTH_GOT_ADR_PREL21 relocation #258

Closed
kovdan01 opened this issue Apr 18, 2024 · 4 comments
Closed

[PAUTHABIELF64] Introduce R_AARCH64_AUTH_GOT_ADR_PREL21 relocation #258

kovdan01 opened this issue Apr 18, 2024 · 4 comments

Comments

@kovdan01
Copy link

It looks like that R_AARCH64_AUTH_GOT_LD_PREL19 described at https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#auth-variant-got-generating-relocations is not enough for tiny code model in case of signed GOT. Since the address of the GOT slot is used as a modifier, we need to store that address somewhere. To take this address, we should probably use adr instruction with 21-bit immediate.

I suggest to add a R_AARCH64_AUTH_GOT_ADR_PREL21 relocation which would correspond to the following assembly operator adr x16, :got_auth:sym.

@kovdan01
Copy link
Author

Tagging @asl

@smithp35
Copy link
Contributor

Thanks for reporting. I guess that this would take the example for the small code-model

adrp x8, :got_auth: symbol
add x8, x8, :got_auth_lo12: symbol
ldr x0, [x8]
// Authenticate to get unsigned pointer
autia x0, x8

And use something like

adr x8, :got_auth: symbol // Needs new relocation like R_AARCH64_GOT_ADR_PREL21
ldr x0, [x8]
// Authenticate to get unsigned pointer
autia x0, x

I'd probably use R_AARCH64_AUTH_GOT_ADR_PREL_LO21 to follow the convention set by R_<CLS>_ ADR_PREL_LO21

Will hopefully get to this within a few days.

@smithp35
Copy link
Contributor

PR for addition of relocation #259

@kovdan01
Copy link
Author

Closing the issue as resolved in #259

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

No branches or pull requests

2 participants