mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
____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:
parent
ef889ffe8d
commit
6a9f82ac93
@ -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,
|
||||
|
22
sysdeps/mips/____longjmp_chk.c
Normal file
22
sysdeps/mips/____longjmp_chk.c
Normal 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>
|
@ -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. */
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user