.note.GNU-stack sections emitted in object files control whether the linker emits a PT_GNU_STACK header. This header in turn tells ld.so and the kernel whether the stack should be executable. The linker emits the PT_GNU_STACK header if any input object file has a .note.GNU-stack section, and the header has the exec bit set if any .note.GNU-stack section is SEC_CODE, *or if any file is missing the note*. ie. Linking a mix of files, some of which have the note section and others that don't, result in PT_GNU_STACK asking for an exec stack. On powerpc64, nested functions do not require a trampoline on the stack, so there is no need for an executable stack. gcc should either emit .note.GNU-stack section on all object files (remove !defined __powerpc64__ in the last few lines of config/rs6000/ppc-asm.h), or better, not emit any notes (not call file_end_indicate_exec_stack when -m64).
Subject: Bug 21098 CVSROOT: /cvs/gcc Module name: gcc Changes by: amodra@gcc.gnu.org 2005-04-19 07:07:11 Modified files: gcc : ChangeLog gcc/config/rs6000: linux64.h rs6000.c Log message: PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8358&r2=2.8359 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/linux64.h.diff?cvsroot=gcc&r1=1.74&r2=1.75 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.808&r2=1.809
Subject: Bug 21098 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: amodra@gcc.gnu.org 2005-04-29 00:19:57 Modified files: gcc : ChangeLog gcc/config/rs6000: linux64.h rs6000.c Log message: PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.203&r2=2.7592.2.204 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/linux64.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.74&r2=1.74.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.788.2.5&r2=1.788.2.6
Subject: Bug 21098 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: amodra@gcc.gnu.org 2005-04-29 00:32:05 Modified files: gcc : ChangeLog gcc/config/rs6000: linux64.h rs6000.c Log message: PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.844&r2=2.2326.2.845 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/linux64.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.53.4.11&r2=1.53.4.12 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.576.2.44&r2=1.576.2.45
Fixed on all active branches
Subject: Bug 21098 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-rhl-branch Changes by: jakub@gcc.gnu.org 2005-05-03 23:02:54 Modified files: gcc : ChangeLog gcc/config/rs6000: linux64.h rs6000.c Log message: Revert: 2005-04-29 Alan Modra <amodra@bigpond.net.au> PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=2.7592.2.10.2.26&r2=2.7592.2.10.2.27 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/linux64.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=1.74.12.1&r2=1.74.12.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=1.788.4.8&r2=1.788.4.9
Subject: Bug 21098 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-rhl-branch Changes by: jakub@gcc.gnu.org 2005-05-06 11:59:51 Modified files: gcc : ChangeLog gcc/config/rs6000: linux64.h rs6000.c Log message: Revert: 2005-04-29 Alan Modra <amodra@bigpond.net.au> PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=2.2326.2.399.2.75&r2=2.2326.2.399.2.76 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/linux64.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.53.4.6.2.5&r2=1.53.4.6.2.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.576.2.15.2.16&r2=1.576.2.15.2.17
Subject: Bug 21098 Author: jakub Date: Wed Nov 23 20:47:12 2005 New Revision: 107432 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107432 Log: 2005-05-04 Jakub Jelinek <jakub@redhat.com> Revert: 2005-04-29 Alan Modra <amodra@bigpond.net.au> PR target/21098 * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. 2004-09-20 Jakub Jelinek <jakub@redhat.com> * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also on ppc64-linux. * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on ia64-linux. * config/ia64/crtbegin.asm: Likewise. * config/ia64/crtend.asm: Likewise. * config/ia64/crti.asm: Likewise. * config/ia64/crtn.asm: Likewise. 2004-05-14 Jakub Jelinek <jakub@redhat.com> * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. boehm-gc/ 2005-02-08 Jakub Jelinek <jakub@redhat.com> * ia64_save_regs_in_stack.s: Moved to... * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack on Linux. libffi/ 2005-02-08 Jakub Jelinek <jakub@redhat.com> * src/alpha/osf.S: Add .note.GNU-stack on Linux. * src/s390/sysv.S: Likewise. * src/powerpc/linux64.S: Likewise. * src/powerpc/linux64_closure.S: Likewise. * src/powerpc/ppc_closure.S: Likewise. * src/powerpc/sysv.S: Likewise. * src/x86/unix64.S: Likewise. * src/x86/sysv.S: Likewise. * src/sparc/v8.S: Likewise. * src/sparc/v9.S: Likewise. * src/m68k/sysv.S: Likewise. * src/ia64/unix.S: Likewise. * src/arm/sysv.S: Likewise. Added: branches/redhat/gcc-4_1-branch/boehm-gc/ia64_save_regs_in_stack.S - copied, changed from r107414, branches/redhat/gcc-4_1-branch/boehm-gc/ia64_save_regs_in_stack.s Removed: branches/redhat/gcc-4_1-branch/boehm-gc/ia64_save_regs_in_stack.s Modified: branches/redhat/gcc-4_1-branch/boehm-gc/ChangeLog branches/redhat/gcc-4_1-branch/gcc/ChangeLog branches/redhat/gcc-4_1-branch/gcc/config/ia64/crtbegin.asm branches/redhat/gcc-4_1-branch/gcc/config/ia64/crtend.asm branches/redhat/gcc-4_1-branch/gcc/config/ia64/crti.asm branches/redhat/gcc-4_1-branch/gcc/config/ia64/crtn.asm branches/redhat/gcc-4_1-branch/gcc/config/ia64/lib1funcs.asm branches/redhat/gcc-4_1-branch/gcc/config/ia64/linux.h branches/redhat/gcc-4_1-branch/gcc/config/rs6000/linux64.h branches/redhat/gcc-4_1-branch/gcc/config/rs6000/ppc-asm.h branches/redhat/gcc-4_1-branch/gcc/config/rs6000/rs6000.c branches/redhat/gcc-4_1-branch/libffi/ChangeLog branches/redhat/gcc-4_1-branch/libffi/src/alpha/osf.S branches/redhat/gcc-4_1-branch/libffi/src/arm/sysv.S branches/redhat/gcc-4_1-branch/libffi/src/ia64/unix.S branches/redhat/gcc-4_1-branch/libffi/src/m68k/sysv.S branches/redhat/gcc-4_1-branch/libffi/src/powerpc/linux64.S branches/redhat/gcc-4_1-branch/libffi/src/powerpc/linux64_closure.S branches/redhat/gcc-4_1-branch/libffi/src/powerpc/ppc_closure.S branches/redhat/gcc-4_1-branch/libffi/src/powerpc/sysv.S branches/redhat/gcc-4_1-branch/libffi/src/s390/sysv.S branches/redhat/gcc-4_1-branch/libffi/src/sparc/v8.S branches/redhat/gcc-4_1-branch/libffi/src/sparc/v9.S branches/redhat/gcc-4_1-branch/libffi/src/x86/sysv.S branches/redhat/gcc-4_1-branch/libffi/src/x86/unix64.S