Commit 443728bb by H.J. Lu Committed by H.J. Lu

re PR target/14925 (libunwind enabled gcc generates incompatible libgcc_s.so.1)

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.

From-SVN: r87066
parent d20bf446
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.
2004-09-03 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (x86_branch_hints): Remove m_PENT4 and
m_NOCONA.
......
......@@ -532,8 +532,16 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
# Additional sources to handle exceptions; overridden by targets as needed.
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
LIB2ADDEHSTATIC = $(LIB2ADDEH)
LIB2ADDEHSHARED = $(LIB2ADDEH)
LIB2ADDEHDEP = unwind.h unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h
# Don't build libunwind by default.
LIBUNWIND =
LIBUNWINDDEP =
SHLIBUNWIND_LINK =
SHLIBUNWIND_INSTALL =
# nm flags to list global symbols in libgcc object files.
SHLIB_NM_FLAGS = -pg
......@@ -1205,7 +1213,13 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext
LIB2ADD='$(LIB2ADD)' \
LIB2ADD_ST='$(LIB2ADD_ST)' \
LIB2ADDEH='$(LIB2ADDEH)' \
LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \
LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \
LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
LIBUNWIND='$(LIBUNWIND)' \
LIBUNWINDDEP='$(LIBUNWINDDEP)' \
SHLIBUNWIND_LINK='$(SHLIBUNWIND_LINK)' \
SHLIBUNWIND_INSTALL='$(SHLIBUNWIND_INSTALL)' \
FPBIT='$(FPBIT)' \
FPBIT_FUNCS='$(FPBIT_FUNCS)' \
LIB2_DIVMOD_FUNCS='$(LIB2_DIVMOD_FUNCS)' \
......@@ -3051,6 +3065,7 @@ mostlyclean: lang.mostlyclean
clean: mostlyclean lang.clean
-rm -f libgcc.a libgcc_eh.a libgcov.a
-rm -f libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
-rm -f libunwind*
-rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
-rm -f options.c options.h optionlist
-rm -f cs-*
......@@ -3880,6 +3895,7 @@ stage1-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcov.a
-rm -f stage1/libgcc_s*$(SHLIB_EXT)
-rm -f stage1/libunwind*
-cp libgcc.a stage1
-$(RANLIB_FOR_TARGET) stage1/libgcc.a
-cp libgcov.a stage1
......@@ -3888,6 +3904,7 @@ stage1-start:
$(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stage1
-cp libunwind* stage1
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stage1/$${f} . ; \
else true; \
......@@ -3915,6 +3932,7 @@ stage2-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stage2/libgcc.a stage2/libgcov.a stage2/libgcc_eh.a
-rm -f stage2/libgcc_s*$(SHLIB_EXT)
-rm -f stage2/libunwind*
-cp libgcc.a stage2
-$(RANLIB_FOR_TARGET) stage2/libgcc.a
-cp libgcov.a stage2
......@@ -3923,6 +3941,7 @@ stage2-start:
$(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stage2
-cp libunwind* stage2
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stage2/$${f} . ; \
else true; \
......@@ -3946,6 +3965,7 @@ stage3-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stage3/libgcc.a stage3/libgcov.a stage3/libgcc_eh.a
-rm -f stage3/libgcc_s*$(SHLIB_EXT)
-rm -f stage3/libunwind*
-cp libgcc.a stage3
-$(RANLIB_FOR_TARGET) stage3/libgcc.a
-cp libgcov.a stage3
......@@ -3954,6 +3974,7 @@ stage3-start:
$(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stage3
-cp libunwind* stage3
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stage3/$${f} . ; \
else true; \
......@@ -3977,6 +3998,7 @@ stage4-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stage4/libgcc.a stage4/libgcov.a stage4/libgcc_eh.a
-rm -f stage4/libgcc_s*$(SHLIB_EXT)
-rm -f stage4/libunwind*
-cp libgcc.a stage4
-$(RANLIB_FOR_TARGET) stage4/libgcc.a
-cp libgcov.a stage4
......@@ -3985,6 +4007,7 @@ stage4-start:
$(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stage4
-cp libunwind* stage4
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stage4/$${f} . ; \
else true; \
......@@ -4006,6 +4029,7 @@ stageprofile-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a
-rm -f stageprofile/libgcc_s*$(SHLIB_EXT)
-rm -f stageprofile/libunwind*
-cp libgcc.a stageprofile
-$(RANLIB_FOR_TARGET) stageprofile/libgcc.a
-cp libgcov.a stageprofile
......@@ -4014,6 +4038,7 @@ stageprofile-start:
$(RANLIB_FOR_TARGET) stageprofile/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stageprofile
-cp libunwind* stageprofile
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stageprofile/$${f} . ; \
else true; \
......@@ -4035,6 +4060,7 @@ stagefeedback-start:
-if [ -f collect-ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
-rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a
-rm -f stagefeedback/libgcc_s*$(SHLIB_EXT)
-rm -f stagefeedback/libunwind*
-rm -f *.da
-for dir in fixinc po testsuite $(SUBDIRS); \
do \
......@@ -4048,6 +4074,7 @@ stagefeedback-start:
$(RANLIB_FOR_TARGET) stagefeedback/libgcc_eh.a; \
fi
-cp libgcc_s*$(SHLIB_EXT) stagefeedback
-cp libunwind* stagefeedback
-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
cp stagefeedback/$${f} . ; \
else true; \
......
......@@ -1148,12 +1148,12 @@ ia64*-*-freebsd*)
;;
ia64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h"
tmake_file="${tmake_file} ia64/t-ia64 ia64/t-glibc"
tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
if test x$with_system_libunwind != xyes ; then
tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
fi
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
if test x"$use_libunwind_exceptions" = xyes; then
tmake_file="$tmake_file t-libunwind"
fi
;;
ia64*-*-hpux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h ia64/sysv4.h ia64/hpux.h"
......
......@@ -573,9 +573,6 @@
/* Define if your assembler mis-optimizes .eh_frame data. */
#undef USE_AS_TRADITIONAL_FORMAT
/* Define if gcc should use -lunwind. */
#undef USE_LIBUNWIND_EXCEPTIONS
/* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but
still efficiently supported by the host hardware. */
#undef USE_LONG_LONG_FOR_WIDEST_FAST_INT
......
LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c
# Use system libunwind library on IA-64 GLIBC based system.
LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
$(srcdir)/unwind-compat.c
# Build libunwind for IA-64 GLIBC based system.
LIBUNWIND = $(srcdir)/config/ia64/fde-glibc.c \
$(srcdir)/config/ia64/unwind-ia64.c
LIBUNWINDDEP = unwind.inc
......@@ -23,6 +23,8 @@ LIBGCC1_TEST =
# We do not want to include the EH stuff that linux uses, we want to use
# the HP-UX libunwind library.
T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
LIB2ADDEH =
SHLIB_EXT = .so
......
......@@ -37,6 +37,7 @@
#include "tm.h"
#include "unwind.h"
#include "unwind-ia64.h"
#include "unwind-compat.h"
#include "ia64intrin.h"
/* This isn't thread safe, but nice for occasional tests. */
......@@ -2381,4 +2382,24 @@ uw_identify_context (struct _Unwind_Context *context)
}
#include "unwind.inc"
#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
alias (_Unwind_Backtrace);
alias (_Unwind_DeleteException);
alias (_Unwind_FindEnclosingFunction);
alias (_Unwind_FindTableEntry);
alias (_Unwind_ForcedUnwind);
alias (_Unwind_GetBSP);
alias (_Unwind_GetCFA);
alias (_Unwind_GetGR);
alias (_Unwind_GetIP);
alias (_Unwind_GetLanguageSpecificData);
alias (_Unwind_GetRegionStart);
alias (_Unwind_RaiseException);
alias (_Unwind_Resume);
alias (_Unwind_Resume_or_Rethrow);
alias (_Unwind_SetGR);
alias (_Unwind_SetIP);
#endif
#endif
# Use the system libunwind library.
#
# Override the default value from t-slibgcc-elf-ver and mention -lunwind
# so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
# libunwind.
SHLIB_LC = -lunwind -lc
LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
$(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
# Build libunwind for ELF with the GNU linker.
# Use unwind-dw2-fde-glibc
LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c
LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
SHLIBUNWIND_SOVERSION = 7
SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
-Wl,-z,text -Wl,-z,defs \
-o $(SHLIBUNWIND_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
rm -f $(SHLIB_SOLINK) && \
$(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIBUNWIND_INSTALL = \
$$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
$(INSTALL_DATA) $(SHLIBUNWIND_NAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIBUNWIND_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
......@@ -1114,20 +1114,10 @@ AC_ARG_ENABLE(sjlj-exceptions,
AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
[Define 0/1 to force the choice for exception handling model.])])
if test x$host = x$target; then
AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
else
use_libunwind_default=no
fi
# Use libunwind based exception handling.
AC_ARG_ENABLE(libunwind-exceptions,
[ --enable-libunwind-exceptions force use libunwind for exceptions],
use_libunwind_exceptions=$enableval,
use_libunwind_exceptions=$use_libunwind_default)
if test x"$use_libunwind_exceptions" = xyes; then
AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
[Define if gcc should use -lunwind.])
fi
# For platforms with the unwind ABI which includes an unwind library,
# libunwind, we can choose to use the system libunwind.
AC_ARG_WITH(system-libunwind,
[ --with-system-libunwind use installed libunwind])
# --------------------------------------------------------
# Build, host, and target specific configuration fragments
......
......@@ -2933,8 +2933,9 @@ have installed.
IA-64 processor (also known as IPF, or Itanium Processor Family)
running GNU/Linux.
If you are using the optional libunwind library, then you must use
libunwind 0.96 or later.
If you are using the installed system libunwind library with
@option{--with-system-libunwind}, then you must use libunwind 0.98 or
later.
None of the following versions of GCC has an ABI that is compatible
with any of the other versions in this list, with the exception that
......@@ -2956,6 +2957,8 @@ the option @option{--with-gnu-as} may be necessary.
The GCC libunwind library has not been ported to HPUX. This means that for
GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
is required to build GCC. For GCC 3.3 and later, this is the default.
For gcc 3.4.3 and later, @option{--enable-libunwind-exceptions} is
removed and the system libunwind library will always be used.
@html
<hr />
......
......@@ -1703,6 +1703,9 @@ init_spec (void)
#else
"-lgcc_s%M"
#endif
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
,
"-lgcc",
"-lgcc_eh"
......
/* 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
/* 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. */
#define symver(name, version) \
__asm__ (".symver " #name"," #name "@" #version)
#define alias(name) \
__typeof(name) __libunwind##name __attribute__ ((alias (#name)))
/* 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 const fde * __libunwind__Unwind_Find_FDE
(void *, struct dwarf_eh_bases *);
const fde *
_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
{
__libunwind__Unwind_Find_FDE (pc, bases);
}
symver (_Unwind_Find_FDE, GCC_3.0);
#endif
......@@ -46,6 +46,7 @@
#define NO_BASE_OF_ENCODED_VALUE
#include "unwind-pe.h"
#include "unwind-dw2-fde.h"
#include "unwind-compat.h"
#include "gthr.h"
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
......@@ -306,3 +307,7 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
#define _Unwind_Find_FDE _Unwind_Find_FDE
#include "unwind-dw2-fde.c"
#endif
#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
alias (_Unwind_Find_FDE);
#endif
......@@ -1317,4 +1317,24 @@ uw_identify_context (struct _Unwind_Context *context)
#include "unwind.inc"
#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
alias (_Unwind_Backtrace);
alias (_Unwind_DeleteException);
alias (_Unwind_FindEnclosingFunction);
alias (_Unwind_FindTableEntry);
alias (_Unwind_ForcedUnwind);
alias (_Unwind_GetDataRelBase);
alias (_Unwind_GetTextRelBase);
alias (_Unwind_GetCFA);
alias (_Unwind_GetGR);
alias (_Unwind_GetIP);
alias (_Unwind_GetLanguageSpecificData);
alias (_Unwind_GetRegionStart);
alias (_Unwind_RaiseException);
alias (_Unwind_Resume);
alias (_Unwind_Resume_or_Rethrow);
alias (_Unwind_SetGR);
alias (_Unwind_SetIP);
#endif
#endif /* !USING_SJLJ_EXCEPTIONS */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment