From 7e0d34b56110216f0c7344a00a7fa3b22c4813aa Mon Sep 17 00:00:00 2001 From: Andrew Dixie Date: Sat, 19 Sep 2015 22:57:47 +0000 Subject: [PATCH] xcoff.h (EH_FRAME_IN_DATA_SECTION): Delete. 2015-09-19 Andrew Dixie David Edelsohn * 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 From-SVN: r227937 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/rs6000/xcoff.h | 26 +++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11db7da84ac..49c959be355 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-09-19 Andrew Dixie + David Edelsohn + + * 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 * config/pa/pa.c (pa_function_ok_for_sibcall): Remove special treatment diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h index 0bfe9d91ce5..be1f708b857 100644 --- a/gcc/config/rs6000/xcoff.h +++ b/gcc/config/rs6000/xcoff.h @@ -264,7 +264,7 @@ #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)); \ @@ -296,10 +296,26 @@ "\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) -- 2.30.2