PATCH: target attributes for libgcc2 unwind functions

Sandra Loosemore sandra@codesourcery.com
Wed Sep 12 16:36:00 GMT 2007


This patch is needed to fix problems in the mips*-sde-elf 
configurations, which build multilibs for -mips16.  Mips16 mode supports 
the hard float ABI, but the hard float registers are not actually 
accessible in mips16 mode, so it causes problems for programs containing 
mixed mips16 and nomips16 code to be linked with mips16 library routines 
that need to save/restore the FP registers, but can't.  So, this patch 
adds a hook for target-specific attributes on the unwind functions, and 
makes the MIPS back end use it to attach an explicit nomips16 attribute 
to those functions.

I did a bootstrap on i686 Linux as well as testing in a MIPS SDE 
configuration.

OK to commit?

-Sandra


2007-09-12  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.
	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 44-unwind-attribute.patch
Type: text/x-patch
Size: 13167 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070912/03002e90/attachment.bin>


More information about the Gcc-patches mailing list