Patchwork [committed] TILE-Gx/TILEPro: use pc relative/indirect encoding in eh data

login
register
mail settings
Submitter Walter Lee
Date March 26, 2013, 6:48 a.m.
Message ID <201303260648.r2Q6mopY016535@farm-0001.internal.tilera.com>
Download mbox | patch
Permalink /patch/231093/
State New
Headers show

Comments

Walter Lee - March 26, 2013, 6:48 a.m.
This patch switches eh data to always use pc relative/indirect
encoding, to avoid relocations of unaligned words.  Backported to 4.7
and 4.8.

	* config/tilegx/tilegx.c (tilegx_asm_preferred_eh_data_format):
	Use indirect/pcrel encoding.
	* config/tilepro/tilepro.c (tilepro_asm_preferred_eh_data_format):
	Ditto.

Patch

Index: gcc/config/tilegx/tilegx.c
===================================================================
--- gcc/config/tilegx/tilegx.c	(revision 197072)
+++ gcc/config/tilegx/tilegx.c	(working copy)
@@ -4786,13 +4786,8 @@  tilegx_reorg (void)
 int
 tilegx_asm_preferred_eh_data_format (int code ATTRIBUTE_UNUSED, int global)
 {
-  if (flag_pic)
-    {
-      int type = TARGET_32BIT ? DW_EH_PE_sdata4 : DW_EH_PE_sdata8;
-      return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | type;
-    }
-  else
-    return DW_EH_PE_absptr;
+  int type = TARGET_32BIT ? DW_EH_PE_sdata4 : DW_EH_PE_sdata8;
+  return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | type;
 }
 
 
Index: gcc/config/tilepro/tilepro.c
===================================================================
--- gcc/config/tilepro/tilepro.c	(revision 197072)
+++ gcc/config/tilepro/tilepro.c	(working copy)
@@ -4338,10 +4338,7 @@  tilepro_reorg (void)
 int
 tilepro_asm_preferred_eh_data_format (int code ATTRIBUTE_UNUSED, int global)
 {
-  if (flag_pic)
-    return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
-  else
-    return DW_EH_PE_absptr;
+  return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
 }