Linux build: silence objtool warnings

After #17401 the Linux build produces some stack related warnings.

Silence them with the `STACK_FRAME_NON_STANDARD` macro.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #17410
This commit is contained in:
Attila Fülöp
2025-06-05 02:40:09 +02:00
committed by Brian Behlendorf
parent d0ea4c617b
commit b608b95247
5 changed files with 74 additions and 0 deletions
@@ -49,6 +49,7 @@
#define _ASM
#include <sys/asm_linkage.h>
#include <sys/frame.h>
/* Windows userland links with OpenSSL */
#if !defined (_WIN32) || defined (_KERNEL)
@@ -377,6 +378,7 @@ FUNCTION(_aesni_ctr32_ghash_6x)
RET
.cfi_endproc
SET_SIZE(_aesni_ctr32_ghash_6x)
STACK_FRAME_NON_STANDARD _aesni_ctr32_ghash_6x
#endif /* ifdef HAVE_MOVBE */
.balign 32
@@ -705,6 +707,7 @@ FUNCTION(_aesni_ctr32_ghash_no_movbe_6x)
RET
.cfi_endproc
SET_SIZE(_aesni_ctr32_ghash_no_movbe_6x)
STACK_FRAME_NON_STANDARD _aesni_ctr32_ghash_no_movbe_6x
ENTRY_ALIGN(aesni_gcm_decrypt, 32)
.cfi_startproc
@@ -822,6 +825,7 @@ ENTRY_ALIGN(aesni_gcm_decrypt, 32)
RET
.cfi_endproc
SET_SIZE(aesni_gcm_decrypt)
STACK_FRAME_NON_STANDARD aesni_gcm_decrypt
.balign 32
FUNCTION(_aesni_ctr32_6x)
@@ -1197,6 +1201,7 @@ ENTRY_ALIGN(aesni_gcm_encrypt, 32)
RET
.cfi_endproc
SET_SIZE(aesni_gcm_encrypt)
STACK_FRAME_NON_STANDARD aesni_gcm_encrypt
#endif /* !_WIN32 || _KERNEL */
@@ -1256,6 +1261,18 @@ SECTION_STATIC
.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.balign 64
/* Workaround for missing asm macro in RHEL 8. */
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
.section .discard.func_stack_frame_non_standard, "aw"
#ifdef HAVE_MOVBE
.long _aesni_ctr32_ghash_6x - .
#endif
.long _aesni_ctr32_ghash_no_movbe_6x - .
.long aesni_gcm_decrypt - .
.long aesni_gcm_encrypt - .
#endif
/* Mark the stack non-executable. */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -23,6 +23,7 @@
#define _ASM
#include <sys/asm_linkage.h>
#include <sys/frame.h>
SECTION_STATIC
@@ -1419,6 +1420,7 @@ ENTRY_ALIGN(zfs_sha256_transform_x64, 16)
RET
.cfi_endproc
SET_SIZE(zfs_sha256_transform_x64)
STACK_FRAME_NON_STANDARD zfs_sha256_transform_x64
ENTRY_ALIGN(zfs_sha256_transform_shani, 64)
.cfi_startproc
@@ -1627,6 +1629,7 @@ ENTRY_ALIGN(zfs_sha256_transform_shani, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha256_transform_shani)
STACK_FRAME_NON_STANDARD zfs_sha256_transform_shani
ENTRY_ALIGN(zfs_sha256_transform_ssse3, 64)
.cfi_startproc
@@ -2738,6 +2741,7 @@ ENTRY_ALIGN(zfs_sha256_transform_ssse3, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha256_transform_ssse3)
STACK_FRAME_NON_STANDARD zfs_sha256_transform_ssse3
ENTRY_ALIGN(zfs_sha256_transform_avx, 64)
.cfi_startproc
@@ -3812,6 +3816,7 @@ ENTRY_ALIGN(zfs_sha256_transform_avx, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha256_transform_avx)
STACK_FRAME_NON_STANDARD zfs_sha256_transform_avx
ENTRY_ALIGN(zfs_sha256_transform_avx2, 64)
.cfi_startproc
@@ -5097,6 +5102,18 @@ ENTRY_ALIGN(zfs_sha256_transform_avx2, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha256_transform_avx2)
STACK_FRAME_NON_STANDARD zfs_sha256_transform_avx2
/* Workaround for missing asm macro in RHEL 8. */
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
.section .discard.func_stack_frame_non_standard, "aw"
.long zfs_sha256_transform_x64 - .
.long zfs_sha256_transform_shani - .
.long zfs_sha256_transform_ssse3 - .
.long zfs_sha256_transform_avx - .
.long zfs_sha256_transform_avx2 - .
#endif
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -23,6 +23,7 @@
#define _ASM
#include <sys/asm_linkage.h>
#include <sys/frame.h>
SECTION_STATIC
@@ -1462,6 +1463,7 @@ ENTRY_ALIGN(zfs_sha512_transform_x64, 16)
RET
.cfi_endproc
SET_SIZE(zfs_sha512_transform_x64)
STACK_FRAME_NON_STANDARD zfs_sha512_transform_x64
ENTRY_ALIGN(zfs_sha512_transform_avx, 64)
.cfi_startproc
@@ -2626,6 +2628,7 @@ ENTRY_ALIGN(zfs_sha512_transform_avx, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha512_transform_avx)
STACK_FRAME_NON_STANDARD zfs_sha512_transform_avx
ENTRY_ALIGN(zfs_sha512_transform_avx2, 64)
.cfi_startproc
@@ -4004,6 +4007,16 @@ ENTRY_ALIGN(zfs_sha512_transform_avx2, 64)
RET
.cfi_endproc
SET_SIZE(zfs_sha512_transform_avx2)
STACK_FRAME_NON_STANDARD zfs_sha512_transform_avx2
/* Workaround for missing asm macro in RHEL 8. */
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
.section .discard.func_stack_frame_non_standard, "aw"
.long zfs_sha512_transform_x64 - .
.long zfs_sha512_transform_avx - .
.long zfs_sha512_transform_avx2 - .
#endif
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits