Skip to content

Commit

Permalink
Add the BTI elf note to the AArch64 SHA2 assembly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zxombie authored Apr 15, 2024
1 parent 4725e54 commit c6da985
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/icp/asm-aarch64/sha2/sha256-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions module/icp/asm-aarch64/sha2/sha512-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6da985

Please sign in to comment.