____longjmp_chk for MIPS.

* sysdeps/mips/____longjmp_chk.c: New file.
	* sysdeps/mips/__longjmp.c: If CHECK_SP is defined, use it.  Don't
	undefine __longjmp.
	* sysdeps/mips64/__longjmp.c: Likewise.
This commit is contained in:
Joseph Myers 2009-05-16 22:24:56 +00:00
parent ef889ffe8d
commit 6a9f82ac93
4 changed files with 41 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2009-05-16 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/____longjmp_chk.c: New file.
* sysdeps/mips/__longjmp.c: If CHECK_SP is defined, use it. Don't
undefine __longjmp.
* sysdeps/mips64/__longjmp.c: Likewise.
2009-05-16 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c,

View File

@ -0,0 +1,22 @@
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdio.h>
#define __longjmp ____longjmp_chk
#define CHECK_SP
#include <__longjmp.c>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1995, 1997, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1995, 1997, 2000, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@ -20,8 +20,6 @@
#include <setjmp.h>
#include <stdlib.h>
#undef __longjmp
#ifndef __GNUC__
#error This file uses GNU C extensions; you must compile with GCC.
#endif
@ -36,6 +34,11 @@ __longjmp (env, val_arg)
Without this it saves $a1 in a register which gets clobbered
along the way. */
register int val asm ("a1");
#ifdef CHECK_SP
register long sp asm ("$29");
if ((long) (env[0].__sp) < sp)
__fortify_fail ("longjmp causes uninitialized stack frame");
#endif
#ifdef __mips_hard_float
/* Pull back the floating point callee-saved registers. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004
/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@ -22,8 +22,6 @@
#include <sgidefs.h>
#include <stdlib.h>
#undef __longjmp
#ifndef __GNUC__
#error This file uses GNU C extensions; you must compile with GCC.
#endif
@ -38,6 +36,11 @@ __longjmp (env, val_arg)
Without this it saves $a1 in a register which gets clobbered
along the way. */
register int val asm ("a1");
#ifdef CHECK_SP
register long long sp asm ("$29");
if ((long long) (env[0].__sp) < sp)
__fortify_fail ("longjmp causes uninitialized stack frame");
#endif
#ifdef __mips_hard_float
/* Pull back the floating point callee-saved registers. */