Page MenuHomeFreeBSD

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

Authored by dim on Wed, Jan 7, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 26, 2:11 AM
Unknown Object (File)
Thu, Jan 22, 5:39 PM
Unknown Object (File)
Mon, Jan 19, 4:28 PM
Unknown Object (File)
Mon, Jan 19, 4:07 PM
Unknown Object (File)
Mon, Jan 19, 2:54 PM
Unknown Object (File)
Sun, Jan 18, 4:02 PM
Unknown Object (File)
Mon, Jan 12, 9:55 AM
Unknown Object (File)
Mon, Jan 12, 2:21 AM
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.Wed, Jan 7, 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.Wed, Jan 7, 5:19 PM