diff options
author | Andrew Turner <andrew.turner4@arm.com> | 2024-04-15 20:53:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:53:39 +0000 |
commit | c6da985e28d7071b187bd928e7fd41ba9e9f6aa7 (patch) | |
tree | 35188d1195b783e1c1ab0cd10b7aa93c8dd3e4ca | |
parent | 4725e543be32f74d3a0a46ce3bb5c8e89280b471 (diff) | |
download | src-c6da985e28d7071b187bd928e7fd41ba9e9f6aa7.tar.gz src-c6da985e28d7071b187bd928e7fd41ba9e9f6aa7.zip |
Add the BTI elf note to the AArch64 SHA2 assembly
On ELF platforms there is a note to specify when an application or
library supports BTI. When linking one of these the linker needs
all input object files to have the note. If not it will not include
it in the output file.
Normally the compiler would generate it, but for assembly files we
need to do it our selves.
Add the note to the aarch64 sha256 and sha512 assembly files.
Tested by building with BTI enabled and using the -zbti-report=error
flag to lld that makes it an error if the note is missing.
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Andrew Turner <andrew.turner4@arm.com>
Closes #16086
-rw-r--r-- | module/icp/asm-aarch64/sha2/sha256-armv8.S | 10 | ||||
-rw-r--r-- | module/icp/asm-aarch64/sha2/sha512-armv8.S | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/module/icp/asm-aarch64/sha2/sha256-armv8.S b/module/icp/asm-aarch64/sha2/sha256-armv8.S index 7ae486e4e229..4dcdd3b65d0b 100644 --- a/module/icp/asm-aarch64/sha2/sha256-armv8.S +++ b/module/icp/asm-aarch64/sha2/sha256-armv8.S @@ -21,6 +21,16 @@ #if defined(__aarch64__) + .section .note.gnu.property,"a",@note + .p2align 3 + .word 4 + .word 16 + .word 5 + .asciz "GNU" + .word 3221225472 + .word 4 + .word 3 + .word 0 .text .align 6 diff --git a/module/icp/asm-aarch64/sha2/sha512-armv8.S b/module/icp/asm-aarch64/sha2/sha512-armv8.S index 9c61eeee4d7b..f6c8f7742912 100644 --- a/module/icp/asm-aarch64/sha2/sha512-armv8.S +++ b/module/icp/asm-aarch64/sha2/sha512-armv8.S @@ -21,6 +21,16 @@ #if defined(__aarch64__) + .section .note.gnu.property,"a",@note + .p2align 3 + .word 4 + .word 16 + .word 5 + .asciz "GNU" + .word 3221225472 + .word 4 + .word 3 + .word 0 .text .align 6 |