From owner-svn-src-all@FreeBSD.ORG Fri Jan 14 11:31:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68981065674; Fri, 14 Jan 2011 11:31:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB6338FC08; Fri, 14 Jan 2011 11:31:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EBVMF0086408; Fri, 14 Jan 2011 11:31:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EBVMMC086403; Fri, 14 Jan 2011 11:31:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101141131.p0EBVMMC086403@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Jan 2011 11:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217396 - head/contrib/gcc/config/rs6000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 11:31:23 -0000 Author: kib Date: Fri Jan 14 11:31:22 2011 New Revision: 217396 URL: http://svn.freebsd.org/changeset/base/217396 Log: Configure gcc to emit .note.GNU-stack for both 32 and 64 bits PowerPC. Mark gcc-provided asm files as not requiring executable stack. It seems that non-FreeBSD ABIs for powerpc64 claim stack non-executable. Due to this, rs6000_elf_end_indicate_exec_stack() only emit the note for 32 bit target. I decided not to change FreeBSD ABI and patch emit the notes for both variants. Reviewed and tested by: nwhitehorn Modified: head/contrib/gcc/config/rs6000/crtsavres.asm head/contrib/gcc/config/rs6000/freebsd.h head/contrib/gcc/config/rs6000/rs6000.c head/contrib/gcc/config/rs6000/tramp.asm Modified: head/contrib/gcc/config/rs6000/crtsavres.asm ============================================================================== --- head/contrib/gcc/config/rs6000/crtsavres.asm Fri Jan 14 11:28:34 2011 (r217395) +++ head/contrib/gcc/config/rs6000/crtsavres.asm Fri Jan 14 11:31:22 2011 (r217396) @@ -305,3 +305,5 @@ FUNC_END(_restgpr_15_x) FUNC_END(_restgpr_14_x) #endif + + .section .note.GNU-stack,"",%progbits Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Fri Jan 14 11:28:34 2011 (r217395) +++ head/contrib/gcc/config/rs6000/freebsd.h Fri Jan 14 11:31:22 2011 (r217396) @@ -230,6 +230,8 @@ } #endif +#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack + /* FreeBSD doesn't support saving and restoring 64-bit regs with a 32-bit kernel. This is supported when running on a 64-bit kernel with COMPAT_FREEBSD32, but tell GCC it isn't so that our 32-bit binaries @@ -242,3 +244,5 @@ #define PROFILE_HOOK(LABEL) \ do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0) +#undef NEED_INDICATE_EXEC_STACK +#define NEED_INDICATE_EXEC_STACK 1 Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Fri Jan 14 11:28:34 2011 (r217395) +++ head/contrib/gcc/config/rs6000/rs6000.c Fri Jan 14 11:31:22 2011 (r217396) @@ -18426,7 +18426,7 @@ rs6000_elf_declare_function_name (FILE * static void rs6000_elf_end_indicate_exec_stack (void) { - if (TARGET_32BIT) + if (NEED_INDICATE_EXEC_STACK) file_end_indicate_exec_stack (); } #endif Modified: head/contrib/gcc/config/rs6000/tramp.asm ============================================================================== --- head/contrib/gcc/config/rs6000/tramp.asm Fri Jan 14 11:28:34 2011 (r217395) +++ head/contrib/gcc/config/rs6000/tramp.asm Fri Jan 14 11:31:22 2011 (r217396) @@ -115,3 +115,5 @@ FUNC_START(__trampoline_setup) FUNC_END(__trampoline_setup) #endif + + .section .note.GNU-stack,"",%progbits