icp: emit .note.GNU-stack section for all ELF targets

On FreeBSD, linking the zfs kernel module with binutils ld 2.44 shows
the following warning:

    ld: warning: aesni-gcm-avx2-vaes.o: missing .note.GNU-stack section
    implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a
    future version of the linker

Some of the `.S` files under `module/icp/asm-x86_64/modes` check whether
to emit the `.note.GNU-stack` section using:

    #if defined(__linux__) && defined(__ELF__)

We could add `&& defined(__FreeBSD__)` to the test, but since all other
`.S` files in the OpenZFS tree use:

    #ifdef __ELF__

it would seem more logical to use that instead. Any recent ELF platform
should support these note sections by now.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #18119
This commit is contained in:
Dimitry Andric 2026-01-08 18:21:12 +01:00 committed by Tony Hutter
parent 65e13c33d8
commit 4cc3056c56
3 changed files with 3 additions and 3 deletions

View File

@ -1316,7 +1316,7 @@ SET_SIZE(aes_gcm_dec_update_vaes_avx2)
#endif /* !_WIN32 || _KERNEL */ #endif /* !_WIN32 || _KERNEL */
/* Mark the stack non-executable. */ /* Mark the stack non-executable. */
#if defined(__linux__) && defined(__ELF__) #ifdef __ELF__
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits
#endif #endif

View File

@ -1275,7 +1275,7 @@ SECTION_STATIC
#endif #endif
/* Mark the stack non-executable. */ /* Mark the stack non-executable. */
#if defined(__linux__) && defined(__ELF__) #ifdef __ELF__
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits
#endif #endif

View File

@ -714,7 +714,7 @@ SET_OBJ(.Lrem_8bit)
.balign 64 .balign 64
/* Mark the stack non-executable. */ /* Mark the stack non-executable. */
#if defined(__linux__) && defined(__ELF__) #ifdef __ELF__
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits
#endif #endif