xcoff.h (EH_FRAME_IN_DATA_SECTION): Delete.
authorAndrew Dixie <andrewd@gentrack.com>
Sat, 19 Sep 2015 22:57:47 +0000 (22:57 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Sat, 19 Sep 2015 22:57:47 +0000 (18:57 -0400)
2015-09-19  Andrew Dixie  <andrewd@gentrack.com>
            David Edelsohn  <dje.gcc@gmail.com>

        * config/rs6000/xcoff.h (EH_FRAME_IN_DATA_SECTION): Delete.
        (ASM_PREFERRED_EH_DATA_FORMAT): Define.
        (EH_FRAME_THROUGH_COLLECT2): Define.
        (EH_TABLES_CAN_BE_READ_ONLY): Define.
        (ASM_OUTPUT_DWARF_PCREL): Define.
        (ASM_OUTPUT_DWARF_DATAREL): Define.

Co-Authored-By: David Edelsohn <dje.gcc@gmail.com>
From-SVN: r227937

gcc/ChangeLog
gcc/config/rs6000/xcoff.h

index 11db7da84ac06d6e66ea98a9070a06845ba9678f..49c959be355af197970011efc43aaf95e7ece558 100644 (file)
@@ -1,3 +1,13 @@
+2015-09-19  Andrew Dixie  <andrewd@gentrack.com>
+           David Edelsohn  <dje.gcc@gmail.com>
+
+       * config/rs6000/xcoff.h (EH_FRAME_IN_DATA_SECTION): Delete.
+       (ASM_PREFERRED_EH_DATA_FORMAT): Define.
+       (EH_FRAME_THROUGH_COLLECT2): Define.
+       (EH_TABLES_CAN_BE_READ_ONLY): Define.
+       (ASM_OUTPUT_DWARF_PCREL): Define.
+       (ASM_OUTPUT_DWARF_DATAREL): Define.
+
 2015-09-19  John David Anglin  <danglin@gcc.gnu.org>
 
        * config/pa/pa.c (pa_function_ok_for_sibcall): Remove special treatment
index 0bfe9d91ce548f40290418250f74c4ba64f79d69..be1f708b857f1f81fd3b0a059420609e0d860085 100644 (file)
 
 #ifdef HAVE_AS_TLS
 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE)  \
-  do { fputs(COMMON_ASM_OP, (FILE));                   \
+  do { fputs (COMMON_ASM_OP, (FILE));                  \
        RS6000_OUTPUT_BASENAME ((FILE), (NAME));                \
        fprintf ((FILE), "[UL]," HOST_WIDE_INT_PRINT_UNSIGNED"\n", \
        (SIZE));                                                \
   "\t.csect .data[RW]," XCOFF_CSECT_DEFAULT_ALIGNMENT_STR
 
 
-/* Define to prevent DWARF2 unwind info in the data section rather
-   than in the .eh_frame section.  We do this because the AIX linker
-   would otherwise garbage collect these sections.  */
-#define EH_FRAME_IN_DATA_SECTION 1
+/* The eh_frames are put in the read-only text segment.
+   Local code labels/function will also be in the local text segment so use
+   PC relative addressing.
+   Global symbols must be in the data segment to allow loader relocations.
+   So use DW_EH_PE_indirect to allocate a slot in the local data segment.
+   There is no constant offset to this data segment from the text segment,
+   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))
+
+#define EH_FRAME_THROUGH_COLLECT2 1
+#define EH_TABLES_CAN_BE_READ_ONLY 1
+
+#define ASM_OUTPUT_DWARF_PCREL(FILE,SIZE,LABEL) \
+  rs6000_asm_output_dwarf_pcrel ((FILE), (SIZE), (LABEL));
+
+#define ASM_OUTPUT_DWARF_DATAREL(FILE,SIZE,LABEL) \
+  rs6000_asm_output_dwarf_datarel ((FILE), (SIZE), (LABEL));
 
 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)