svn commit: r217850 - head/lib/libc/sys

Konstantin Belousov kib at FreeBSD.org
Tue Jan 25 21:06:49 UTC 2011


Author: kib
Date: Tue Jan 25 21:06:49 2011
New Revision: 217850
URL: http://svn.freebsd.org/changeset/base/217850

Log:
  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

Modified:
  head/lib/libc/sys/Makefile.inc

Modified: head/lib/libc/sys/Makefile.inc
==============================================================================
--- head/lib/libc/sys/Makefile.inc	Tue Jan 25 21:04:55 2011	(r217849)
+++ head/lib/libc/sys/Makefile.inc	Tue Jan 25 21:06:49 2011	(r217850)
@@ -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 \


More information about the svn-src-all mailing list