diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-04 00:15:42 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-04 00:15:42 +0000 |
commit | 8bdf23ae810238b3a11f4af286b4a3772fb7244f (patch) | |
tree | 7f137e56cfc324eb4fa83beb9e5fe8ca4d670570 /gcc/unwind-compat.c | |
parent | aa2294444e9bdb7c4401be3f76b2d06183b59f27 (diff) | |
download | gcc-8bdf23ae810238b3a11f4af286b4a3772fb7244f.tar.gz |
2004-09-03 H.J. Lu <hongjiu.lu@intel.com>
PR target/14925:
Makefile.in (LIB2ADDEHSTATIC): New.
(LIB2ADDEHSHARED): New.
(LIBUNWIND): New.
(LIBUNWINDDEP): New.
(SHLIBUNWIND_LINK): New.
(SHLIBUNWIND_INSTALL): New.
(libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND,
LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL.
(clean): Remove libunwind*
(stage1-start): Remove and copy stage1/libunwind*.
(stage2-start): Remove and copy stage2/libunwind*.
(stage3-start): Remove and copy stage3/libunwind*.
(stage4-start): Remove and copy stage4/libunwind*.
(stageprofile-start): Remove and copy stageprofile/libunwind*.
(stagefeedback-start): Remove and copy stagefeedback/libunwind*.
* config.gcc (ia64*-*-linux*): Always add t-libunwind to
tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to
tmake_file if --with-system-libunwind isn't used.
* config/ia64/t-glibc-libunwind: New file.
* config/t-libunwind-elf: Likewise.
* unwind-compat.c: Likewise.
* unwind-compat.h: Likewise.
* unwind-dw2-fde-compat.c: Likewise.
* config/ia64/t-glibc (LIB2ADDEH): Updated.
* config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.
* config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define
aliases if needed.
* unwind-dw2-fde-glibc.c: Likewise.
* unwind-dw2.c: Likewise.
* config/t-libunwind (LIB2ADDEH): Updated.
(LIB2ADDEHSTATIC): New.
(T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.
(TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER.
* configure.ac: Change --enable-libunwind-exceptions to
--with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS.
* configure: Regenerated.
* config.in: Updated.
* doc/install.texi (ia64-*-linux): Require libunwind 0.98 or
above and mention --with-system-libunwind.
(ia64-*-hpux*): Mention --enable-libunwind-exceptions is
removed in gcc 3.4.3 and later.
* gcc.c (init_spec): Add -lunwind to -lgcc_s if
USE_LIBUNWIND_EXCEPTIONS is defined.
* mklibgcc.in: Support libunwind.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87066 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unwind-compat.c')
-rw-r--r-- | gcc/unwind-compat.c | 206 |
1 files changed, 206 insertions, 0 deletions
diff --git a/gcc/unwind-compat.c b/gcc/unwind-compat.c new file mode 100644 index 00000000000..26f45ac8e57 --- /dev/null +++ b/gcc/unwind-compat.c @@ -0,0 +1,206 @@ +/* Backward compatibility unwind routines. + Copyright (C) 2004 + Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC 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 General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS) +#include "unwind.h" +#include "unwind-dw2-fde.h" +#include "unwind-compat.h" + +extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace + (_Unwind_Trace_Fn, void *); + +_Unwind_Reason_Code +_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument) +{ + return __libunwind_Unwind_Backtrace (trace, trace_argument); +} +symver (_Unwind_Backtrace, GCC_3.3); + +extern void __libunwind_Unwind_DeleteException + (struct _Unwind_Exception *); + +void +_Unwind_DeleteException (struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_DeleteException (exc); +} +symver (_Unwind_DeleteException, GCC_3.0); + +extern void * __libunwind_Unwind_FindEnclosingFunction (void *); + +void * +_Unwind_FindEnclosingFunction (void *pc) +{ + return __libunwind_Unwind_FindEnclosingFunction (pc); +} +symver (_Unwind_FindEnclosingFunction, GCC_3.3); + +extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); + +_Unwind_Reason_Code +_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, + _Unwind_Stop_Fn stop, void * stop_argument) +{ + return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument); +} +symver (_Unwind_ForcedUnwind, GCC_3.0); + +extern _Unwind_Word __libunwind_Unwind_GetCFA + (struct _Unwind_Context *); + +_Unwind_Word +_Unwind_GetCFA (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetCFA (context); +} +symver (_Unwind_GetCFA, GCC_3.3); + +#ifdef __ia64__ +extern _Unwind_Word __libunwind_Unwind_GetBSP + (struct _Unwind_Context *); + +_Unwind_Word +_Unwind_GetBSP (struct _Unwind_Context * context) +{ + return __libunwind_Unwind_GetBSP (context); +} +symver (_Unwind_GetBSP, GCC_3.3.2); +#else +extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetDataRelBase (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetDataRelBase (context); +} +symver (_Unwind_GetDataRelBase, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetTextRelBase (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetTextRelBase (context); +} +symver (_Unwind_GetTextRelBase, GCC_3.0); +#endif + +extern _Unwind_Word __libunwind_Unwind_GetGR + (struct _Unwind_Context *, int ); + +_Unwind_Word +_Unwind_GetGR (struct _Unwind_Context *context, int index) +{ + return __libunwind_Unwind_GetGR (context, index); +} +symver (_Unwind_GetGR, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetIP (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetIP (context); +} +symver (_Unwind_GetIP, GCC_3.0); + +extern void *__libunwind_Unwind_GetLanguageSpecificData + (struct _Unwind_Context *); + +void * +_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetLanguageSpecificData (context); +} +symver (_Unwind_GetLanguageSpecificData, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetRegionStart (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetRegionStart (context); +} +symver (_Unwind_GetRegionStart, GCC_3.0); + +extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException + (struct _Unwind_Exception *); + +_Unwind_Reason_Code +_Unwind_RaiseException(struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_RaiseException (exc); +} +symver (_Unwind_RaiseException, GCC_3.0); + +extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *); + +void +_Unwind_Resume (struct _Unwind_Exception *exc) +{ + __libunwind_Unwind_Resume (exc); +} +symver (_Unwind_Resume, GCC_3.0); + +extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow + (struct _Unwind_Exception *); + +_Unwind_Reason_Code +_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_Resume_or_Rethrow (exc); +} +symver (_Unwind_Resume_or_Rethrow, GCC_3.3); + +extern void __libunwind_Unwind_SetGR + (struct _Unwind_Context *, int, _Unwind_Word); + +void +_Unwind_SetGR (struct _Unwind_Context *context, int index, + _Unwind_Word val) +{ + __libunwind_Unwind_SetGR (context, index, val); +} +symver (_Unwind_SetGR, GCC_3.0); + +extern void __libunwind_Unwind_SetIP + (struct _Unwind_Context *, _Unwind_Ptr); + +void +_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val) +{ + return __libunwind_Unwind_SetIP (context, val); +} +symver (_Unwind_SetIP, GCC_3.0); +#endif |