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.
This commit is contained in:
Clément Chigot
2021-03-11 11:08:18 +01:00
committed by Alan Modra
parent 0c929e83c1
commit 2c1bef53de
8 changed files with 400 additions and 239 deletions

View File

@@ -300,7 +300,7 @@ static const struct xlat_table rtype_xlat[] =
RTYPE_ENTRY (NEG),
RTYPE_ENTRY (REL),
RTYPE_ENTRY (TOC),
RTYPE_ENTRY (RTB),
RTYPE_ENTRY (TRL),
RTYPE_ENTRY (GL),
RTYPE_ENTRY (TCL),
RTYPE_ENTRY (BA),
@@ -308,7 +308,6 @@ static const struct xlat_table rtype_xlat[] =
RTYPE_ENTRY (RL),
RTYPE_ENTRY (RLA),
RTYPE_ENTRY (REF),
RTYPE_ENTRY (TRL),
RTYPE_ENTRY (TRLA),
RTYPE_ENTRY (RRTBI),
RTYPE_ENTRY (RRTBA),