Page MenuHomeFreeBSD

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

Authored by dim on Jan 7 2026, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 28, 12:48 PM
Unknown Object (File)
Sat, Feb 28, 11:23 AM
Unknown Object (File)
Thu, Feb 26, 4:38 PM
Unknown Object (File)
Mon, Feb 16, 10:51 PM
Unknown Object (File)
Mon, Feb 9, 8:32 PM
Unknown Object (File)
Jan 26 2026, 2:11 AM
Unknown Object (File)
Jan 22 2026, 5:39 PM
Unknown Object (File)
Jan 19 2026, 4:28 PM
Subscribers

Details

Summary

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.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim requested review of this revision.Jan 7 2026, 5:13 PM

I've had to submit some fixes for this exact same #if defined(__linux__) && defined(__ELF__) elsewhere and we're probably going to have to continue chasing this down in various upstreams. IMO it's fine to commit this locally but we should also submit to OpenZFS and to BoringSSL (if not there already).

This revision is now accepted and ready to land.Jan 7 2026, 5:19 PM