Emit .note.GNU-stack for the syscall stubs generated by libc only on

architectures that support this .note. In particular, do not unneccessary
emit the notes on ia64 and sparc64, which ABI require non-executable stacks.

Tested by:	marcel
This commit is contained in:
kib 2011-01-25 21:06:49 +00:00
parent b902a8a176
commit 736c72ab1a

View File

@ -53,16 +53,23 @@ SYM_MAPS+= ${.CURDIR}/sys/Symbol.map
# Generated files
CLEANFILES+= ${SASM} ${SPSEUDO}
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
${MACHINE_CPUARCH} == "powerpc"
NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
.else
NOTE_GNU_STACK=''
.endif
${SASM}:
printf '#include "compat.h"\n' > ${.TARGET}
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET}
printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET}
printf ${NOTE_GNU_STACK} >>${.TARGET}
${SPSEUDO}:
printf '#include "compat.h"\n' > ${.TARGET}
printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
>> ${.TARGET}
printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET}
printf ${NOTE_GNU_STACK} >>${.TARGET}
MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \
aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \