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

[NFC][AArch64][ELF][PAC] Update AUTH relocation IDs #74986

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

kovdan01
Copy link
Contributor

ARM-software/abi-aa#227 changes IDs of R_AARCH64_AUTH_ABS64 and R_AARCH64_AUTH_RELATIVE in PAuth ABI specification from draft ones (0xe100 and 0xe200) to final ones (0x244 and 0x411).

This patch changes the values in llvm correspondingly.

ARM-software/abi-aa#227 changes IDs of
`R_AARCH64_AUTH_ABS64` and `R_AARCH64_AUTH_RELATIVE` in PAuth ABI
specification from draft ones (`0xe100` and `0xe200`) to final
ones (`0x244` and `0x411`).

This patch changes the values in llvm correspondingly.
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 10, 2023

@llvm/pr-subscribers-llvm-binary-utilities
@llvm/pr-subscribers-mc

@llvm/pr-subscribers-backend-aarch64

Author: Daniil Kovalev (kovdan01)

Changes

ARM-software/abi-aa#227 changes IDs of R_AARCH64_AUTH_ABS64 and R_AARCH64_AUTH_RELATIVE in PAuth ABI specification from draft ones (0xe100 and 0xe200) to final ones (0x244 and 0x411).

This patch changes the values in llvm correspondingly.


Full diff: https://github.com/llvm/llvm-project/pull/74986.diff

2 Files Affected:

  • (modified) llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def (+2-2)
  • (modified) llvm/test/MC/AArch64/elf-reloc-ptrauth.s (+8-8)
diff --git a/llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def b/llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def
index b8ab5113bedf80..30375de420e302 100644
--- a/llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def
+++ b/llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def
@@ -121,6 +121,7 @@ ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12,        0x23a)
 ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC,     0x23b)
 ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12,       0x23c)
 ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC,    0x23d)
+ELF_RELOC(R_AARCH64_AUTH_ABS64,                      0x244)
 // Dynamic relocations start
 ELF_RELOC(R_AARCH64_COPY,                            0x400)
 ELF_RELOC(R_AARCH64_GLOB_DAT,                        0x401)
@@ -134,8 +135,7 @@ ELF_RELOC(R_AARCH64_TLS_DTPREL64,                    0x405)
 ELF_RELOC(R_AARCH64_TLS_TPREL64,                     0x406)
 ELF_RELOC(R_AARCH64_TLSDESC,                         0x407)
 ELF_RELOC(R_AARCH64_IRELATIVE,                       0x408)
-ELF_RELOC(R_AARCH64_AUTH_ABS64,                      0xe100)
-ELF_RELOC(R_AARCH64_AUTH_RELATIVE,                   0xe200)
+ELF_RELOC(R_AARCH64_AUTH_RELATIVE,                   0x411)
 
 // ELF_RELOC(R_AARCH64_P32_NONE,                         0)
 ELF_RELOC(R_AARCH64_P32_ABS32,                       0x001)
diff --git a/llvm/test/MC/AArch64/elf-reloc-ptrauth.s b/llvm/test/MC/AArch64/elf-reloc-ptrauth.s
index 1ce008117ac302..3bd8f5c19932ee 100644
--- a/llvm/test/MC/AArch64/elf-reloc-ptrauth.s
+++ b/llvm/test/MC/AArch64/elf-reloc-ptrauth.s
@@ -5,14 +5,14 @@
 
 // RELOC: Relocation section '.rela.test' at offset 0x230 contains 8 entries:
 // RELOC-NEXT:  Offset Info Type Symbol's Value Symbol's Name + Addend
-// RELOC-NEXT: 0000000000000000 000000010000e100 R_AARCH64_AUTH_ABS64 0000000000000000 .helper + 0
-// RELOC-NEXT: 0000000000000010 000000080000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g1 + 0
-// RELOC-NEXT: 0000000000000020 000000090000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g2 + 0
-// RELOC-NEXT: 0000000000000030 0000000a0000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g3 + 0
-// RELOC-NEXT: 0000000000000040 0000000b0000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g4 + 7
-// RELOC-NEXT: 0000000000000050 0000000c0000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g5 - 3
-// RELOC-NEXT: 0000000000000060 000000020000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g 6 + 0
-// RELOC-NEXT: 0000000000000070 0000000d0000e100 R_AARCH64_AUTH_ABS64 0000000000000000 _g 7 + 7
+// RELOC-NEXT: 0000000000000000 0000000100000244 R_AARCH64_AUTH_ABS64 0000000000000000 .helper + 0
+// RELOC-NEXT: 0000000000000010 0000000800000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g1 + 0
+// RELOC-NEXT: 0000000000000020 0000000900000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g2 + 0
+// RELOC-NEXT: 0000000000000030 0000000a00000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g3 + 0
+// RELOC-NEXT: 0000000000000040 0000000b00000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g4 + 7
+// RELOC-NEXT: 0000000000000050 0000000c00000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g5 - 3
+// RELOC-NEXT: 0000000000000060 0000000200000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g 6 + 0
+// RELOC-NEXT: 0000000000000070 0000000d00000244 R_AARCH64_AUTH_ABS64 0000000000000000 _g 7 + 7
 
 // RELOC: Hex dump of section '.test':
 //                VVVVVVVV addend, not needed for rela

@kovdan01 kovdan01 merged commit 8410ee4 into llvm:main Dec 10, 2023
7 checks passed
@dwblaikie
Copy link
Collaborator

Once a patch has been sent for review, please don't commit it until it has been aproved.

@kovdan01
Copy link
Contributor Author

Once a patch has been sent for review, please don't commit it until it has been aproved.

@dwblaikie OK, just assumed it already discussed in #72713 (comment). Sorry for not providing the link to the discussion previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants