From 7632431698ca47043c3ed1223717578362ae7fa4 Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 30 May 2014 18:31:31 +0000 Subject: [PATCH] Switch eARM to using normal DWARF exception handling. --- .../dist/gcc/common/config/arm/arm-common.c | 3 +++ external/gpl3/gcc/dist/gcc/config/arm/arm.h | 21 ++++++++++++++++--- .../gcc/dist/gcc/config/arm/netbsd-eabi.h | 9 ++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/external/gpl3/gcc/dist/gcc/common/config/arm/arm-common.c b/external/gpl3/gcc/dist/gcc/common/config/arm/arm-common.c index c43a2ce927bd..e48cb6b3abc6 100644 --- a/external/gpl3/gcc/dist/gcc/common/config/arm/arm-common.c +++ b/external/gpl3/gcc/dist/gcc/common/config/arm/arm-common.c @@ -48,6 +48,9 @@ arm_except_unwind_info (struct gcc_options *opts) return UI_SJLJ; #endif + if (ARM_DWARF_UNWIND_TABLES) + return UI_DWARF2; + /* If not using ARM EABI unwind tables... */ if (ARM_UNWIND_INFO) { diff --git a/external/gpl3/gcc/dist/gcc/config/arm/arm.h b/external/gpl3/gcc/dist/gcc/config/arm/arm.h index 9b235ffaca05..a9e34ea65610 100644 --- a/external/gpl3/gcc/dist/gcc/config/arm/arm.h +++ b/external/gpl3/gcc/dist/gcc/config/arm/arm.h @@ -889,6 +889,11 @@ extern int arm_arch_thumb_hwdiv; #define ARM_UNWIND_INFO 0 #endif +/* Overriden by config/arm/netbsd-eabi.h. */ +#ifndef ARM_DWARF_UNWIND_TABLES +#define ARM_DWARF_UNWIND_TABLES 0 +#endif + /* Use r0 and r1 to pass exception handling information. */ #define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM) @@ -899,11 +904,21 @@ extern int arm_arch_thumb_hwdiv; #ifndef ARM_TARGET2_DWARF_FORMAT #define ARM_TARGET2_DWARF_FORMAT DW_EH_PE_pcrel +# if ARM_DWARF_UNWIND_TABLES +/* DWARF unwinding uses the normal indirect/pcrel vs absptr format + for 32bit platforms. */ +# define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ + ((flag_pic \ + && ((GLOBAL) || (CODE))) \ + ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \ + : DW_EH_PE_absptr) +# else /* ttype entries (the only interesting data references used) use TARGET2 relocations. */ -#define ASM_PREFERRED_EH_DATA_FORMAT(code, data) \ - (((code) == 0 && (data) == 1 && ARM_UNWIND_INFO) ? ARM_TARGET2_DWARF_FORMAT \ - : DW_EH_PE_absptr) +# define ASM_PREFERRED_EH_DATA_FORMAT(code, data) \ + (((code) == 0 && (data) == 1 && ARM_UNWIND_INFO) ? ARM_TARGET2_DWARF_FORMAT \ + : DW_EH_PE_absptr) +# endif #endif /* The native (Norcroft) Pascal compiler for the ARM passes the static chain diff --git a/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h b/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h index 4c49b677548a..bdd302fe6dee 100644 --- a/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h +++ b/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h @@ -45,6 +45,13 @@ #undef ARM_DEFAULT_ABI #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX +#undef ARM_EABI_UNWIND_TABLES +#define ARM_EABI_UNWIND_TABLES 0 +#undef ARM_UNWIND_INFO +#define ARM_UNWIND_INFO 0 +#undef ARM_DWARF_UNWIND_TABLES +#define ARM_DWARF_UNWIND_TABLES 1 + #undef TARGET_OS_CPP_BUILTINS #define TARGET_OS_CPP_BUILTINS() \ do \ @@ -52,6 +59,8 @@ if (TARGET_AAPCS_BASED) \ TARGET_BPABI_CPP_BUILTINS(); \ NETBSD_OS_CPP_BUILTINS_ELF(); \ + if (ARM_DWARF_UNWIND_TABLES) \ + builtin_define ("__ARM_DWARF_EH__"); \ if (ARM_EABI_UNWIND_TABLES) \ builtin_define ("__UNWIND_TABLES__"); \ } \