tm.texi (LIBGCC2_UNWIND_ATTRIBUTE): Document.

2007-09-14  Sandra Loosemore  <sandra@codesourcery.com>
	    Nigel Stephens  <nigel@mips.com>

	gcc/
	* doc/tm.texi (LIBGCC2_UNWIND_ATTRIBUTE): Document.
	* unwind-generic.h (LIBGCC2_UNWIND_ATTRIBUTE): Define.
	(_Unwind_RaiseException): Add LIBGCC2_UNWIND_ATTRIBUTE to
	declaration.
	(_Unwind_ForcedUnwind): Likewise.
	(_Unwind_Resume): Likewise.
	(_Unwind_Resume_or_Rethrow): Likewise.
	(_Unwind_Backtrace): Likewise.
	(_Unwind_SjLj_RaiseException): Likewise.
	(_Unwind_SjLj_ForcedUnwind): Likewise.
	(_Unwind_SjLj_Resume): Likewise.
	(_Unwind_SjLj_Resume_or_Rethrow): Likewise.
	* unwind.inc (_Unwind_RaiseException): Add LIBGCC2_UNWIND_ATTRIBUTE
	to definition.
	(_Unwind_ForcedUnwind): Likewise.
	(_Unwind_Resume): Likewise.
	(_Unwind_Resume_or_Rethrow): Likewise.
	(_Unwind_Backtrace): Likewise.
	* unwind-compat.c (_Unwind_Backtrace): Likewise.
	(_Unwind_ForcedUnwind): Likewise.
	(_Unwind_RaiseException): Likewise.
	(_Unwind_Resume): Likewise.
	(_Unwind_Resume_or_Rethrow): Likewise.

	* config/mips/mips.h (LIBGCC2_UNWIND_ATTRIBUTE): Define to force
	nomips16 mode when IN_LIBGCC2 with hard float.

Co-Authored-By: Nigel Stephens <nigel@mips.com>

From-SVN: r128501
This commit is contained in:
Sandra Loosemore 2007-09-14 14:35:12 -04:00 committed by Sandra Loosemore
parent c417817a85
commit 56e449d39a
6 changed files with 82 additions and 23 deletions

View File

@ -1,3 +1,33 @@
2007-09-14 Sandra Loosemore <sandra@codesourcery.com>
Nigel Stephens <nigel@mips.com>
* doc/tm.texi (LIBGCC2_UNWIND_ATTRIBUTE): Document.
* unwind-generic.h (LIBGCC2_UNWIND_ATTRIBUTE): Define.
(_Unwind_RaiseException): Add LIBGCC2_UNWIND_ATTRIBUTE to
declaration.
(_Unwind_ForcedUnwind): Likewise.
(_Unwind_Resume): Likewise.
(_Unwind_Resume_or_Rethrow): Likewise.
(_Unwind_Backtrace): Likewise.
(_Unwind_SjLj_RaiseException): Likewise.
(_Unwind_SjLj_ForcedUnwind): Likewise.
(_Unwind_SjLj_Resume): Likewise.
(_Unwind_SjLj_Resume_or_Rethrow): Likewise.
* unwind.inc (_Unwind_RaiseException): Add LIBGCC2_UNWIND_ATTRIBUTE
to definition.
(_Unwind_ForcedUnwind): Likewise.
(_Unwind_Resume): Likewise.
(_Unwind_Resume_or_Rethrow): Likewise.
(_Unwind_Backtrace): Likewise.
* unwind-compat.c (_Unwind_Backtrace): Likewise.
(_Unwind_ForcedUnwind): Likewise.
(_Unwind_RaiseException): Likewise.
(_Unwind_Resume): Likewise.
(_Unwind_Resume_or_Rethrow): Likewise.
* config/mips/mips.h (LIBGCC2_UNWIND_ATTRIBUTE): Define to force
nomips16 mode when IN_LIBGCC2 with hard float.
2007-09-14 Richard Sandiford <rsandifo@nildram.co.uk> 2007-09-14 Richard Sandiford <rsandifo@nildram.co.uk>
* config/mips/sdemtk.opt: Update to GPLv3. * config/mips/sdemtk.opt: Update to GPLv3.

View File

@ -582,6 +582,17 @@ extern enum mips_llsc_setting mips_llsc;
#endif #endif
#endif /* IN_LIBGCC2 */ #endif /* IN_LIBGCC2 */
/* Force the call stack unwinders in unwind.inc not to be MIPS16 code
when compiled with hardware floating point. This is because MIPS16
code cannot save and restore the floating-point registers, which is
important if in a mixed MIPS16/non-MIPS16 environment. */
#ifdef IN_LIBGCC2
#if __mips_hard_float
#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((__nomips16__))
#endif
#endif /* IN_LIBGCC2 */
#define TARGET_LIBGCC_SDATA_SECTION ".sdata" #define TARGET_LIBGCC_SDATA_SECTION ".sdata"
#ifndef MULTILIB_ENDIAN_DEFAULT #ifndef MULTILIB_ENDIAN_DEFAULT

View File

@ -10336,3 +10336,10 @@ SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
This macro determines the size of the objective C jump buffer for the This macro determines the size of the objective C jump buffer for the
NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value. NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
@end defmac @end defmac
@defmac LIBGCC2_UNWIND_ATTRIBUTE
Define this macro if any target-specific attributes need to be attached
to the functions in @file{libgcc} that provide low-level support for
call stack unwinding. It is used in declarations in @file{unwind-generic.h}
and the associated definitions of those functions.
@end defmac

View File

@ -38,7 +38,7 @@
extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
(_Unwind_Trace_Fn, void *); (_Unwind_Trace_Fn, void *);
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument) _Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument)
{ {
return __libunwind_Unwind_Backtrace (trace, trace_argument); return __libunwind_Unwind_Backtrace (trace, trace_argument);
@ -67,7 +67,7 @@ symver (_Unwind_FindEnclosingFunction, GCC_3.3);
extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind
(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
_Unwind_Stop_Fn stop, void * stop_argument) _Unwind_Stop_Fn stop, void * stop_argument)
{ {
@ -166,7 +166,7 @@ symver (_Unwind_GetRegionStart, GCC_3.0);
extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException
(struct _Unwind_Exception *); (struct _Unwind_Exception *);
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_RaiseException(struct _Unwind_Exception *exc) _Unwind_RaiseException(struct _Unwind_Exception *exc)
{ {
return __libunwind_Unwind_RaiseException (exc); return __libunwind_Unwind_RaiseException (exc);
@ -175,7 +175,7 @@ symver (_Unwind_RaiseException, GCC_3.0);
extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *); extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *);
void void LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume (struct _Unwind_Exception *exc) _Unwind_Resume (struct _Unwind_Exception *exc)
{ {
__libunwind_Unwind_Resume (exc); __libunwind_Unwind_Resume (exc);
@ -185,7 +185,7 @@ symver (_Unwind_Resume, GCC_3.0);
extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow
(struct _Unwind_Exception *); (struct _Unwind_Exception *);
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
{ {
return __libunwind_Unwind_Resume_or_Rethrow (exc); return __libunwind_Unwind_Resume_or_Rethrow (exc);

View File

@ -108,6 +108,12 @@ typedef int _Unwind_Action;
#define _UA_FORCE_UNWIND 8 #define _UA_FORCE_UNWIND 8
#define _UA_END_OF_STACK 16 #define _UA_END_OF_STACK 16
/* The target can override this macro to define any back-end-specific
attributes required for the lowest-level stack frame. */
#ifndef LIBGCC2_UNWIND_ATTRIBUTE
#define LIBGCC2_UNWIND_ATTRIBUTE
#endif
/* This is an opaque type used to refer to a system-specific data /* This is an opaque type used to refer to a system-specific data
structure used by the system unwinder. This context is created and structure used by the system unwinder. This context is created and
destroyed by the system, and passed to the personality routine destroyed by the system, and passed to the personality routine
@ -115,7 +121,8 @@ typedef int _Unwind_Action;
struct _Unwind_Context; struct _Unwind_Context;
/* Raise an exception, passing along the given exception object. */ /* Raise an exception, passing along the given exception object. */
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_RaiseException (struct _Unwind_Exception *);
/* Raise an exception for forced unwinding. */ /* Raise an exception for forced unwinding. */
@ -123,20 +130,21 @@ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
(int, _Unwind_Action, _Unwind_Exception_Class, (int, _Unwind_Action, _Unwind_Exception_Class,
struct _Unwind_Exception *, struct _Unwind_Context *, void *); struct _Unwind_Exception *, struct _Unwind_Context *, void *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Stop_Fn, _Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
void *);
/* Helper to invoke the exception_cleanup routine. */ /* Helper to invoke the exception_cleanup routine. */
extern void _Unwind_DeleteException (struct _Unwind_Exception *); extern void _Unwind_DeleteException (struct _Unwind_Exception *);
/* Resume propagation of an existing exception. This is used after /* Resume propagation of an existing exception. This is used after
e.g. executing cleanup code, and not to implement rethrowing. */ e.g. executing cleanup code, and not to implement rethrowing. */
extern void _Unwind_Resume (struct _Unwind_Exception *); extern void LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume (struct _Unwind_Exception *);
/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow /* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow
a normal exception that was handled. */ a normal exception that was handled. */
extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
/* @@@ Use unwind data to perform a stack backtrace. The trace callback /* @@@ Use unwind data to perform a stack backtrace. The trace callback
is called for every stack frame in the call chain, but no cleanup is called for every stack frame in the call chain, but no cleanup
@ -144,7 +152,8 @@ extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
(struct _Unwind_Context *, void *); (struct _Unwind_Context *, void *);
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
/* These functions are used for communicating information about the unwind /* These functions are used for communicating information about the unwind
context (i.e. the unwind descriptors and the user register state) between context (i.e. the unwind descriptors and the user register state) between
@ -191,12 +200,14 @@ struct SjLj_Function_Context;
extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
(struct _Unwind_Exception *); _Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); _Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); extern void LIBGCC2_UNWIND_ATTRIBUTE
extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); _Unwind_SjLj_Resume (struct _Unwind_Exception *);
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
/* @@@ The following provide access to the base addresses for text /* @@@ The following provide access to the base addresses for text
and data-relative addressing in the LDSA. In order to stay link and data-relative addressing in the LDSA. In order to stay link

View File

@ -82,7 +82,7 @@ _Unwind_RaiseException_Phase2(struct _Unwind_Exception *exc,
/* Raise an exception, passing along the given exception object. */ /* Raise an exception, passing along the given exception object. */
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_RaiseException(struct _Unwind_Exception *exc) _Unwind_RaiseException(struct _Unwind_Exception *exc)
{ {
struct _Unwind_Context this_context, cur_context; struct _Unwind_Context this_context, cur_context;
@ -195,7 +195,7 @@ _Unwind_ForcedUnwind_Phase2 (struct _Unwind_Exception *exc,
/* Raise an exception for forced unwinding. */ /* Raise an exception for forced unwinding. */
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
_Unwind_Stop_Fn stop, void * stop_argument) _Unwind_Stop_Fn stop, void * stop_argument)
{ {
@ -219,7 +219,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
/* Resume propagation of an existing exception. This is used after /* Resume propagation of an existing exception. This is used after
e.g. executing cleanup code, and not to implement rethrowing. */ e.g. executing cleanup code, and not to implement rethrowing. */
void void LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume (struct _Unwind_Exception *exc) _Unwind_Resume (struct _Unwind_Exception *exc)
{ {
struct _Unwind_Context this_context, cur_context; struct _Unwind_Context this_context, cur_context;
@ -244,7 +244,7 @@ _Unwind_Resume (struct _Unwind_Exception *exc)
/* Resume propagation of an FORCE_UNWIND exception, or to rethrow /* Resume propagation of an FORCE_UNWIND exception, or to rethrow
a normal exception that was handled. */ a normal exception that was handled. */
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
{ {
struct _Unwind_Context this_context, cur_context; struct _Unwind_Context this_context, cur_context;
@ -278,7 +278,7 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc)
/* Perform stack backtrace through unwind data. */ /* Perform stack backtrace through unwind data. */
_Unwind_Reason_Code _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) _Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument)
{ {
struct _Unwind_Context context; struct _Unwind_Context context;