public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] AIX EH data format
@ 2015-10-07 18:35 David Edelsohn
  2015-10-09 22:12 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: David Edelsohn @ 2015-10-07 18:35 UTC (permalink / raw)
  To: GCC Patches, Richard Henderson

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] AIX EH data format
  2015-10-07 18:35 [PATCH] AIX EH data format David Edelsohn
@ 2015-10-09 22:12 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2015-10-09 22:12 UTC (permalink / raw)
  To: David Edelsohn, GCC Patches

On 10/08/2015 05:35 AM, David Edelsohn wrote:
> 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.

The rs6000 port doesn't have any kind of "code model" to select the size of the 
application here?

I guess considering the way the aix calling convention uses its TOC slices you 
wouldn't have needed one yet.  Perhaps eating the extra space is the most robust.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-09 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07 18:35 [PATCH] AIX EH data format David Edelsohn
2015-10-09 22:12 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).