From 2c1bef53dee85aede31e6de6fa8276d6869f6512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Thu, 11 Mar 2021 11:08:18 +0100 Subject: aix: correct HOWTO table and add missing relocations Since the last time AIX HOWTO table was modified, IBM has now released an official documentation about XCOFF relocations. This commit corrects the wrong ones and add some missing. For now, the "custom" relocations made for xcoff_rtype2howto have been kept. The new relocations are still set as EMPTY_HOWTO because they will be implemented in later commits. In xcoff[64]_ppc_relocate_section, instead of recreating howto from scratch, it's better to use the existing howto from the table and fixing it according to r_size field. bfd/ * coff-rs6000.c (xcoff_calculate_relocation): Correct and add new relocations. (xcoff_howto_table): Likewise. (xcoff_rtype2howto): Increase r_type maximum value. (xcoff_ppc_relocate_section): Reuse predefined HOWTOs instead of create a new one from scratch. Enable only some relocations to have a changing r_size. * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise. (xcoff64_howto_table): Likewise. (xcoff64_rtype2howto): Likewise. (xcoff64_ppc_relocate_section): Likewise. * libxcoff.h (XCOFF_MAX_CALCULATE_RELOCATION): Fix value. binutils/ * od-xcoff.c: Replace RTB by TRL entry. include/ * coff/xcoff.h (R_RTB): Remove. (R_TRL): Fix value. --- include/ChangeLog | 5 +++++ include/coff/xcoff.h | 53 ++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 0a6e4b6..c736323 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2021-03-12 Clément Chigot + + * coff/xcoff.h (R_RTB): Remove. + (R_TRL): Fix value. + 2021-03-05 Craig Blackmore Andrew Burgess diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h index 50ac0df..36651d4 100644 --- a/include/coff/xcoff.h +++ b/include/coff/xcoff.h @@ -97,36 +97,35 @@ The relocations are described in the function xcoff[64]_ppc_relocate_section in coff64-rs6000.c and coff-rs6000.c */ -#define R_POS (0x00) -#define R_NEG (0x01) -#define R_REL (0x02) -#define R_TOC (0x03) -#define R_RTB (0x04) -#define R_GL (0x05) -#define R_TCL (0x06) -#define R_BA (0x08) -#define R_BR (0x0a) -#define R_RL (0x0c) -#define R_RLA (0x0d) -#define R_REF (0x0f) -#define R_TRL (0x12) -#define R_TRLA (0x13) -#define R_RRTBI (0x14) -#define R_RRTBA (0x15) -#define R_CAI (0x16) -#define R_CREL (0x17) -#define R_RBA (0x18) -#define R_RBAC (0x19) -#define R_RBR (0x1a) -#define R_RBRC (0x1b) -#define R_TLS (0x20) +#define R_POS (0x00) +#define R_NEG (0x01) +#define R_REL (0x02) +#define R_TOC (0x03) +#define R_TRL (0x04) +#define R_GL (0x05) +#define R_TCL (0x06) +#define R_BA (0x08) +#define R_BR (0x0a) +#define R_RL (0x0c) +#define R_RLA (0x0d) +#define R_REF (0x0f) +#define R_TRLA (0x13) +#define R_RRTBI (0x14) +#define R_RRTBA (0x15) +#define R_CAI (0x16) +#define R_CREL (0x17) +#define R_RBA (0x18) +#define R_RBAC (0x19) +#define R_RBR (0x1a) +#define R_RBRC (0x1b) +#define R_TLS (0x20) #define R_TLS_IE (0x21) #define R_TLS_LD (0x22) #define R_TLS_LE (0x23) -#define R_TLSM (0x24) -#define R_TLSML (0x25) -#define R_TOCU (0x30) -#define R_TOCL (0x31) +#define R_TLSM (0x24) +#define R_TLSML (0x25) +#define R_TOCU (0x30) +#define R_TOCL (0x31) /* Storage class #defines, from /usr/include/storclass.h that are not already defined in internal.h */ -- cgit v1.1