[patch ping] libffi/boehm-gc/crt files executable stack (missing .note.GNU-stack on .o files)

Jakub Jelinek jakub@redhat.com
Thu Jul 12 11:54:00 GMT 2007


On Thu, Jul 05, 2007 at 12:51:51PM +0200, Matthias Klose wrote:
> The following patch (taken from the redhat/gcc-4_1-branch) adds .note.GNU-stack
> sections for gcc's crt files, libffi and boehm-gc.
> 
> sent first here: http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00948.html
> 
> Updated in the patch is:
> 
> 2007-05-11  Daniel Jacobowitz  <dan@debian.org>
> 
>         * src/arm/sysv.S: Fix ARM comment marker.
> 
> Jakub, is this patch necessary/wanted in the FSF sources?

Yes, except perhaps the ppc64 and ia64 bits.  There it is ambiguous whether
PT_GNU_STACK segments are desirable or not (varries between upstream and
distros) and recent changes in binutils on ia64 and ppc64 assume by
default non-executable stack whe .note.GNU-stack section is not present,
so explicit .note.GNU-stack with "x" needs to be used to force
executable PT_GNU_STACK.
So, I think all the changes except changes in files with /rs6000/, ia64 and
/powerpc/linux64 substrings in filenames should be applied.

> gcc/
> 
> 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/
> 
> 2007-05-11  Daniel Jacobowitz  <dan@debian.org>
> 
> 	* src/arm/sysv.S: Fix ARM comment marker.
> 
> 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.

	Jakub



More information about the Java-patches mailing list