Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2011 21:06:49 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217850 - head/lib/libc/sys
Message-ID:  <201101252106.p0PL6nAI050733@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101252106.p0PL6nAI050733>