From 7220a798137842d72132083954bec6ff3dafc3cd Mon Sep 17 00:00:00 2001 From: jnemeth Date: Thu, 17 Sep 2009 23:07:12 +0000 Subject: [PATCH] Not all platforms can do PaX stuff. The list was derived in private conversation with several developers. The change was tested on sparc64. NetBSD ultra.example.ca 5.99.17 NetBSD 5.99.17 (MODULAR) #0: Tue Sep 15 19:08:02 PDT 2009 jnemeth@ultra.example.ca:/usr/local/current/objdir/sys/arch/sparc64/compile/MODULAR sparc64 NAME CLASS SOURCE REFS SIZE REQUIRES ... exec_elf64 misc filesys 0 6981 coredump ... --- sys/modules/exec_elf32/Makefile | 14 ++++++++++++-- sys/modules/exec_elf64/Makefile | 8 ++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/modules/exec_elf32/Makefile b/sys/modules/exec_elf32/Makefile index 9496a9509085..d7a87a9fde4b 100644 --- a/sys/modules/exec_elf32/Makefile +++ b/sys/modules/exec_elf32/Makefile @@ -1,10 +1,20 @@ -# $NetBSD: Makefile,v 1.1 2008/11/19 18:36:08 ad Exp $ +# $NetBSD: Makefile,v 1.2 2009/09/17 23:07:12 jnemeth Exp $ .include "../Makefile.inc" KMOD= exec_elf32 -CPPFLAGS+= -DEXEC_ELF32 -DPAX_ASLR -DCOREDUMP +CPPFLAGS+= -DEXEC_ELF32 -DCOREDUMP +.if ${MACHINE_ARCH} != "arm" && \ + ${MACHINE_ARCH} != "armeb" && \ + ${MACHINE_ARCH} != "m68000" && \ + ${MACHINE_ARCH} != "m68k" && \ + ${MACHINE_ARCH} != "powerpc" && \ + ${MACHINE_ARCH} != "powerpc64" && \ + ${MACHINE_ARCH} != "sparc" && \ + ${MACHINE_ARCH} != "sparc64" +CPPFLAGS+= -DPAX_ASLR +.endif .PATH: ${S}/kern SRCS= exec_elf32.c core_elf32.c diff --git a/sys/modules/exec_elf64/Makefile b/sys/modules/exec_elf64/Makefile index 3ea336cc4dad..5a291397b142 100644 --- a/sys/modules/exec_elf64/Makefile +++ b/sys/modules/exec_elf64/Makefile @@ -1,10 +1,14 @@ -# $NetBSD: Makefile,v 1.1 2008/11/19 18:36:08 ad Exp $ +# $NetBSD: Makefile,v 1.2 2009/09/17 23:07:12 jnemeth Exp $ .include "../Makefile.inc" KMOD= exec_elf64 -CPPFLAGS+= -DEXEC_ELF64 -DPAX_ASLR -DCOREDUMP +CPPFLAGS+= -DEXEC_ELF64 -DCOREDUMP +.if ${MACHINE_ARCH} != "powerpc64" && \ + ${MACHINE_ARCH} != "sparc64" +CPPFLAGS+= -DPAX_ASLR +.endif .PATH: ${S}/kern SRCS= exec_elf64.c core_elf64.c