summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-01-25 21:06:49 +0000
committerkib <kib@FreeBSD.org>2011-01-25 21:06:49 +0000
commit736c72ab1a257909fc96a743c7c7e9a1e584cbaa (patch)
tree8aa5d0c814842d7b89ddc6cca60d26df67a9a027 /lib/libc
parentb902a8a1767c4005becfcbfd51997125a1f92968 (diff)
downloadFreeBSD-src-736c72ab1a257909fc96a743c7c7e9a1e584cbaa.zip
FreeBSD-src-736c72ab1a257909fc96a743c7c7e9a1e584cbaa.tar.gz
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
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/Makefile.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 7a89471..fe6116a 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -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 \
OpenPOWER on IntegriCloud