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 12, 9:55 AM
Unknown Object (File)
Mon, Jan 12, 2:21 AM
Unknown Object (File)
Sat, Jan 10, 4:56 AM
Unknown Object (File)
Fri, Jan 9, 10:13 PM
Unknown Object (File)
Fri, Jan 9, 8:22 PM
Unknown Object (File)
Fri, Jan 9, 6:54 PM
Unknown Object (File)
Fri, Jan 9, 6:54 PM
Unknown Object (File)
Fri, Jan 9, 4:33 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
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 69685
Build 66568: arc lint + arc unit

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