]>
Commit | Line | Data |
---|---|---|
b168057a | 1 | /* Copyright (C) 2014-2015 Free Software Foundation, Inc. |
93a45ff1 AK |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
5 | modify it under the terms of the GNU Lesser General Public | |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
8 | ||
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public | |
15 | License along with the GNU C Library; if not, see | |
16 | <http://www.gnu.org/licenses/>. | |
17 | ||
2f438e20 SL |
18 | Versioned copy of debug/longjmp_chk.c modified for versioning |
19 | the reverted jmpbuf extension. */ | |
93a45ff1 AK |
20 | |
21 | #include <shlib-compat.h> | |
93a45ff1 | 22 | |
4f41c682 | 23 | #if IS_IN (libc) && defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) |
2f438e20 SL |
24 | /* this is a copy from debug/longjmp_chk.c because we need an unique name |
25 | for __longjmp_chk, but it is already named via a define | |
26 | for __libc_siglongjmp in debug/longjmp_chk.c. */ | |
27 | # include <setjmp.h> | |
28 | ||
29 | // XXX Should move to include/setjmp.h | |
30 | extern void ____longjmp_chk (__jmp_buf __env, int __val) | |
93a45ff1 AK |
31 | __attribute__ ((__noreturn__)); |
32 | ||
2f438e20 SL |
33 | # define __longjmp ____longjmp_chk |
34 | # define __libc_siglongjmp __v1__longjmp_chk | |
93a45ff1 | 35 | |
2f438e20 | 36 | # include <setjmp/longjmp.c> |
93a45ff1 | 37 | |
2f438e20 SL |
38 | /* In glibc release 2.19 a new versions of __longjmp_chk was introduced, |
39 | but was reverted before 2.20. Thus both versions are the same function. */ | |
40 | strong_alias (__v1__longjmp_chk, __v2__longjmp_chk); | |
41 | versioned_symbol (libc, __v1__longjmp_chk, __longjmp_chk, GLIBC_2_11); | |
42 | compat_symbol (libc, __v2__longjmp_chk, __longjmp_chk, GLIBC_2_19); | |
93a45ff1 AK |
43 | |
44 | #else | |
45 | ||
2f438e20 | 46 | # include <debug/longjmp_chk.c> |
93a45ff1 AK |
47 | |
48 | #endif |