[PATCH 4/6] aix: correct HOWTO table and add missing relocations

Alan Modra amodra@gmail.com
Mon Feb 22 07:17:41 GMT 2021


On Tue, Feb 16, 2021 at 09:57:48AM +0000, CHIGOT, CLEMENT wrote:
> 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/ChangeLog:
> 2020-11-20  Clément Chigot  <clement.chigot@atos.net>
> 
>         * coff-rs6000.c (xcoff_calculate_relocation): Correct and
>         add new relocations.
>         (xcoff_howto_table): Likewise.
>         (xcoff_rtype2howto): Increase r_type maximum value possible.
>         (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_reloc_type_br): Moved.
>         (xcoff64_ppc_relocate_section): Moved and reuse predefined HOWTOs.
>         * libxcoff.h (XCOFF_MAX_CALCULATE_RELOCATION): Fix value.
> 
> binutils/ChangeLog:
> 2020-11-20  Clément Chigot  <clement.chigot@atos.net>
> 
>         * od-xcoff.c: Replace RTB by TRL entry.
> 
> include/ChangeLog:
> 2020-11-20  Clément Chigot  <clement.chigot@atos.net>
> 
>         * coff/xcoff.h (R_RTB): Removed.
>         (R_TRL): Fix value.

This all looks reasonable, but for ease of review in future please
split out patches that move functions around from changes to the moved
functions.

+      /* Retrieve default value in HOWTO table and fix up according
+	 to r_size field, if it can be different.
+         This should be made during relocation reading but the algorithms

Leading whitespace ought to be a tab.

+	 are expecting constant howtos.  */
+      memcpy(&howto, &xcoff64_howto_table[rel->r_type], sizeof(howto));

Space before '(' here, twice.


-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list