From: Stafford Horne Date: Sun, 22 Mar 2020 01:13:22 +0000 (+0900) Subject: or1k: Fixup exception header data encodings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e40fdcc4f423dd1c3543979ddb8f33bf01dac5e4;p=gcc.git or1k: Fixup exception header data encodings While running glibc tests several *-textrel tests failed showing that relocations remained against read only sections. It turned out this was related to exception headers data encoding being wrong. By default pointer encoding will always use the DW_EH_PE_absptr format. This patch uses format DW_EH_PE_pcrel and DW_EH_PE_sdata4. Optionally DW_EH_PE_indirect is included for global symbols. This eliminates the relocations. gcc/ChangeLog: * config/or1k/or1k.h (ASM_PREFERRED_EH_DATA_FORMAT): New macro. --- diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h index b686f1bd159..fe01ab81ead 100644 --- a/gcc/config/or1k/or1k.h +++ b/gcc/config/or1k/or1k.h @@ -408,4 +408,8 @@ do { \ ((N) < 4 ? HW_TO_GCC_REGNO (25) + (N) : INVALID_REGNUM) #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, EH_RETURN_REGNUM) +/* Select a format to encode pointers in exception handling data. */ +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ + (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) + #endif /* GCC_OR1K_H */