Skip to content

Commit c6da985

Browse files
authored
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Andrew Turner <[email protected]> Closes #16086
1 parent 4725e54 commit c6da985

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

module/icp/asm-aarch64/sha2/sha256-armv8.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121

2222
#if defined(__aarch64__)
2323

24+
.section .note.gnu.property,"a",@note
25+
.p2align 3
26+
.word 4
27+
.word 16
28+
.word 5
29+
.asciz "GNU"
30+
.word 3221225472
31+
.word 4
32+
.word 3
33+
.word 0
2434
.text
2535

2636
.align 6

module/icp/asm-aarch64/sha2/sha512-armv8.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121

2222
#if defined(__aarch64__)
2323

24+
.section .note.gnu.property,"a",@note
25+
.p2align 3
26+
.word 4
27+
.word 16
28+
.word 5
29+
.asciz "GNU"
30+
.word 3221225472
31+
.word 4
32+
.word 3
33+
.word 0
2434
.text
2535

2636
.align 6

0 commit comments

Comments
 (0)