1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

lib{c,sys}: .note.GNU-stack in syscall stubs

Explicitly disable executable stacks in the syscall stubs on all
architectures.  Previously, aarch64 and riscv64 didn't include the
.note.GNU-stack note due it being disabled by default in those ABIs.

This appears to have been harmless in practice, but better to be clear
in case a different compiler/linker has different defaults.  This also
reduces special cases in the Makefile.

Reported by:	jrtc27
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44883
This commit is contained in:
Brooks Davis 2024-10-04 22:13:41 +01:00
parent 77fd02501f
commit 74f6ec6fe3

View File

@ -129,12 +129,7 @@ SYM_MAPS+= ${LIBSYS_SRCTOP}/${LIBC_ARCH}/Symbol.sys.map
# Generated files
CLEANFILES+= ${SASM} ${SPSEUDO}
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
.else
NOTE_GNU_STACK=''
.endif
.if ${MACHINE_CPUARCH} == "aarch64"
FEATURE_NOTE='\#include <sys/elf_common.h>\nGNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)\n'
.else