diff options
author | Jan Hubicka <jh@suse.cz> | 2005-08-01 20:56:14 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-08-01 18:56:14 +0000 |
commit | 72ce3d4ac1e4cbe6df17edfd13c21727c2b929d2 (patch) | |
tree | 31d77c885d3cf16a8802827282ca87f4977ae3d2 | |
parent | 23d28bfe80ebd227936d746e9e4f25afc28c8fb2 (diff) | |
download | gcc-72ce3d4ac1e4cbe6df17edfd13c21727c2b929d2.zip gcc-72ce3d4ac1e4cbe6df17edfd13c21727c2b929d2.tar.gz gcc-72ce3d4ac1e4cbe6df17edfd13c21727c2b929d2.tar.bz2 |
i386-protos.h (asm_preferred_eh_data_format): Declare.
* i386-protos.h (asm_preferred_eh_data_format): Declare.
* i386.c: Include dwarf2.h
(asm_preferred_eh_data_format): New.
* i386.h (ASM_PREFERRED_EH_DATA_FORMAT): Move offline.
From-SVN: r102638
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 27 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 4 |
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 042da86..1f64ae3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-08-01 Jan Hubicka <jh@suse.cz> + + * i386-protos.h (asm_preferred_eh_data_format): Declare. + * i386.c: Include dwarf2.h + (asm_preferred_eh_data_format): New. + * i386.h (ASM_PREFERRED_EH_DATA_FORMAT): Move offline. + 2005-08-01 Ian Lance Taylor <ian@airs.com> * config/host-linux.c (linux_gt_pch_get_address): Add new name diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 94cecdc..8b34e03 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -269,3 +269,4 @@ extern void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *, enum rtx_code *, enum rtx_code *); extern enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code); #endif +extern int asm_preferred_eh_data_format (int, int); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 69f7bdf..1b77760 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -48,6 +48,7 @@ Boston, MA 02110-1301, USA. */ #include "langhooks.h" #include "cgraph.h" #include "tree-gimple.h" +#include "dwarf2.h" #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -17947,4 +17948,30 @@ ix86_stack_protect_fail (void) : default_hidden_stack_protect_fail (); } +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. + + ??? All x86 object file formats are capable of representing this. + After all, the relocation needed is the same as for the call insn. + Whether or not a particular assembler allows us to enter such, I + guess we'll have to see. */ +int +asm_preferred_eh_data_format (int code, int global) +{ + if (flag_pic) + { +int type = DW_EH_PE_sdata8; + if (!TARGET_64BIT + || ix86_cmodel == CM_SMALL_PIC + || (ix86_cmodel == CM_MEDIUM_PIC && (global || code))) + type = DW_EH_PE_sdata4; + return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | type; + } + if (ix86_cmodel == CM_SMALL + || (ix86_cmodel == CM_MEDIUM && code)) + return DW_EH_PE_udata4; + return DW_EH_PE_absptr; +} + #include "gt-i386.h" diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index d1f5dd9..da4218b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2023,9 +2023,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; Whether or not a particular assembler allows us to enter such, I guess we'll have to see. */ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ - (flag_pic \ - ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\ - : DW_EH_PE_absptr) + asm_preferred_eh_data_format ((CODE), (GLOBAL)) /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ |