[patch] C6X unwinding/exception handling

Paul Brook paul@codesourcery.com
Thu Aug 4 14:32:00 GMT 2011


C6X uses an unwinding/exception handling echeme very similar to that defined 
by the ARM EABI.  The core of the unwinder is the same, so I've pulled it out 
into a common file.

Other than the obvious target specific bits, the main compiler visible 
difference is that the C6X assembler generates the unwinding tables from DWARF 
.cfi directives, rather than the separate set of directives used by the ARM 
assembler.

The libstdc++ changes probably deserve a bit of explanation. The ttype_base 
field was clearly used in an early draft of the ARM EABI, and the current ARM 
definition is a compatible subset of that used by C6X.  
_GLIBCXX_OVERRIDE_TTYPE_ENCODING is an unfortunate hack because when doing the 
ARM implementation I failed to realise ttype_encoding was the same thing as 
R_ARM_TARGET2.  We now have a lot of ARM binaries floating around with that 
field set incorrectly, so it's either this or an ABI bump.

Ok?

Paul

2011-08-04  Paul Brook  <paul@codesourcery.com>
 
	gcc/
	* config/arm/arm.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
	(ARM_TARGET2_DWARF_FORMAT): Provide default definition.
	* config/arm/linux-eabi.h (ARM_TARGET2_DWARF_FORMAT): Define.
	* config/arm/symbian.h (ARM_TARGET2_DWARF_FORMAT): Define.
	* config/arm/uclinux-eabi.h(ARM_TARGET2_DWARF_FORMAT): Define.
	* config/arm/t-bpabi (EXTRA_HEADERS): Add unwind-arm-common.h.
	* config/arm/t-symbian (EXTRA_HEADERS): Add unwind-arm-common.h.
	* config/arm/unwind-arm.c: Use unwind-arm-common.inc.
	* config/arm/unwind-arm.h: Use unwind-arm-common.h.
	(_GLIBCXX_OVERRIDE_TTYPE_ENCODING): Define.
	* config/c6x/c6x.c (c6x_output_file_unwind): Don't rely on dwarf2 code
	enabling unwind tables.
	(c6x_debug_unwind_info): New function.
	(TARGET_ARM_EABI_UNWINDER): Define.
	(TARGET_DEBUG_UNWIND_INFO): Define.
	* config/c6x/c6x.h (DWARF_FRAME_RETURN_COLUMN): Define.
	(TARGET_EXTRA_CFI_SECTION): Remove.
	* config/c6x/t-c6x-elf (LIB2ADDEH, UNWIND_H, EXTRA_HEADERS): Set.
	* config/c6x/libunwind.S: New file.
	* config/c6x/pr-support.c: New file.
	* config/c6x/unwind-c6x.c: New file.
	* config/c6x/unwind-c6x.h: New file.
	* unwind-c.c (PERSONALITY_FUNCTION): Use UNWIND_POINTER_REG.
	* ginclude/unwind-arm-common.h: New file.

	libstdc++-v3/
	* libsupc++/eh_arm.cc (__cxa_end_cleanup): Add C6X implementation.
	* libsupc++/eh_call.cc (__cxa_call_unexpected): Set rtti_base.
	* libsupc++/eh_personality.cc (NO_SIZE_OF_ENCODED_VALUE): Remove
	__ARM_EABI_UNWINDER__ check.
	(parse_lsda_header): Check _GLIBCXX_OVERRIDE_TTYPE_ENCODING.
	(get_ttype_entry): Use generic implementation on ARM EABI.
	(check_exception_spec): Use _Unwind_decode_typeinfo_ptr and
	UNWIND_STACK_REG.
	(PERSONALITY_FUNCTION): Set ttype_base.  Use UNWIND_STACK_REG and
	UNWIND_POINTER_REG.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-patch
Size: 105059 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110804/2f99952c/attachment.bin>


More information about the Libstdc++ mailing list