The recent patches to move GCC exception handling tables on AIX to
read-only data changed the EH data format from absolute pointers to
data-relative or pc-relative, but the offset was encoded as 32 bit,
which isn't robust in 64-bit mode.  This patch adjusts the definition
to selects the encoding based on 32 bit versus 64 bit mode.

I would appreciate any additional eyes on the new design to check if
Andrew and I missed anything.

Bootstrapped on powerpc-ibm-aix7.1.0.0 and tested with g++.dg/eh

Thanks, David

* config/rs6000/xcoff.h (ASM_PREFERRED_EH_DATA_FORMAT): Use 64-bit
encoding in 64-bit mode.

Index: xcoff.h
===================================================================
--- xcoff.h     (revision 228568)
+++ xcoff.h     (working copy)
@@ -307,8 +307,8 @@
    so use addressing relative to the data segment.
  */
 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
-  ((GLOBAL) ? (DW_EH_PE_indirect | DW_EH_PE_datarel | DW_EH_PE_sdata4) \
-           : (DW_EH_PE_pcrel | DW_EH_PE_sdata4))
+  (((GLOBAL) ? DW_EH_PE_indirect | DW_EH_PE_datarel : DW_EH_PE_pcrel) \
+   | (TARGET_64BIT ? DW_EH_PE_sdata8 : DW_EH_PE_sdata4))

 #define EH_FRAME_THROUGH_COLLECT2 1
 #define EH_TABLES_CAN_BE_READ_ONLY 1

Reply via email to