OSDN Git Service

* i386-protos.h (asm_preferred_eh_data_format): Declare.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 2005 18:56:14 +0000 (18:56 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 2005 18:56:14 +0000 (18:56 +0000)
* i386.c: Include dwarf2.h
(asm_preferred_eh_data_format): New.
* i386.h (ASM_PREFERRED_EH_DATA_FORMAT): Move offline.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102638 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h

index 042da86..1f64ae3 100644 (file)
@@ -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
index 94cecdc..8b34e03 100644 (file)
@@ -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);
index 69f7bdf..1b77760 100644 (file)
@@ -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"
index d1f5dd9..da4218b 100644 (file)
@@ -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.  */