From: Richard Henderson Date: Thu, 30 Sep 2004 19:36:28 +0000 (-0700) Subject: qrnnd.asm: Mark for noexecstack. X-Git-Tag: releases/gcc-3.3.6~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe75f88817996d8a0673365637966e3d5d5ce10e;p=thirdparty%2Fgcc.git qrnnd.asm: Mark for noexecstack. * config/alpha/qrnnd.asm: Mark for noexecstack. * unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG. * doc/tm.texi (DWARF_ZERO_REG): New. * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, alpha_expand_epilogue): Revert 2003-09-30 change to store zero. * config/alpha/alpha.h (DWARF_ZERO_REG): New. From-SVN: r88351 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c73f977a060..016d1e0d10cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2004-09-30 Richard Henderson + + * config/alpha/qrnnd.asm: Mark for noexecstack. + +2004-09-30 Richard Henderson + + * unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG. + * doc/tm.texi (DWARF_ZERO_REG): New. + + * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, + alpha_expand_epilogue): Revert 2003-09-30 change to store zero. + * config/alpha/alpha.h (DWARF_ZERO_REG): New. + 2004-09-30 Release Manager * GCC 3.3.5 Released. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 3a0bde446397..e5ee7d8b0e5e 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -6766,11 +6766,6 @@ alpha_sa_mask (imaskP, fmaskP) break; imask |= 1L << regno; } - - /* Glibc likes to use $31 as an unwind stopper for crt0. To - avoid hackery in unwind-dw2.c, we need to actively store a - zero in the prologue of _Unwind_RaiseException et al. */ - imask |= 1UL << 31; } /* If any register spilled, then spill the return address also. */ @@ -7236,24 +7231,6 @@ alpha_expand_prologue () reg_offset += 8; } - /* Store a zero if requested for unwinding. */ - if (imask & (1UL << 31)) - { - rtx insn, t; - - mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset)); - set_mem_alias_set (mem, alpha_sr_alias_set); - insn = emit_move_insn (mem, const0_rtx); - - RTX_FRAME_RELATED_P (insn) = 1; - t = gen_rtx_REG (Pmode, 31); - t = gen_rtx_SET (VOIDmode, mem, t); - t = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, t, REG_NOTES (insn)); - REG_NOTES (insn) = t; - - reg_offset += 8; - } - for (i = 0; i < 31; i++) if (fmask & (1L << i)) { @@ -7674,9 +7651,6 @@ alpha_expand_epilogue () reg_offset += 8; } - if (imask & (1UL << 31)) - reg_offset += 8; - for (i = 0; i < 31; ++i) if (fmask & (1L << i)) { diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 82a23a27063a..62e9f7bbf53e 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -1299,6 +1299,7 @@ do { \ #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26) #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26) #define DWARF_ALT_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (64) +#define DWARF_ZERO_REG 31 /* Describe how we implement __builtin_eh_return. */ #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM) diff --git a/gcc/config/alpha/qrnnd.asm b/gcc/config/alpha/qrnnd.asm index d6373ec1bff9..da9c4bc83388 100644 --- a/gcc/config/alpha/qrnnd.asm +++ b/gcc/config/alpha/qrnnd.asm @@ -26,6 +26,10 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. +#ifdef __ELF__ +.section .note.GNU-stack,"" +#endif + .set noreorder .set noat diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index e0c8ed568c64..354b4b7edbff 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -165,6 +165,11 @@ read_8s (const void *p) { const union unaligned *up = p; return up->s8; } inline _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *context, int index) { +#ifdef DWARF_ZERO_REG + if (index == DWARF_ZERO_REG) + return 0; +#endif + /* This will segfault if the register hasn't been saved. */ return * (_Unwind_Word *) context->reg[index]; }