HomeFreeBSD

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

Description

zfs: 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: emaste, kib, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54578

(cherry picked from commit eb1b6ec7a79aff05f5f10e1d6b1c63a0d8dc5f2f)

Details

Provenance
dimAuthored on Jan 8 2026, 8:35 AM
Reviewer
emaste
Differential Revision
D54578: zfs: emit .note.GNU-stack section for all ELF targets
Parents
rGb16ae773509c: loader.efi: add stride & offset for MacBookPro3,1
Branches
Unknown
Tags
Unknown