]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/ChangeLog
aix: implement R_TOCU and R_TOCL relocations
authorClément Chigot <clement.chigot@atos.net>
Thu, 11 Mar 2021 10:08:19 +0000 (11:08 +0100)
committerAlan Modra <amodra@gmail.com>
Fri, 12 Mar 2021 12:17:23 +0000 (22:47 +1030)
commit4a403be0c1b4540e22c8c608ea0bfecbf0f85e51
tree3908b8d38af9e56e3fd960da596c4d600f5915c5
parent2c1bef53dee85aede31e6de6fa8276d6869f6512
aix: implement R_TOCU and R_TOCL relocations

Implement support for largetoc on XCOFF.
R_TOCU and R_TOCL are referenced by the new BFD defines:
BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO.
A new toc storage class is added XMC_TE.

In order to correctly handle R_TOCU, the logic behind
xcoff_reloc_type_toc is changed to compute the whole TOC offset
instead of just the difference between the "link" offset and the
"assembly" offset.

In gas, add a function to transform addis format used by AIX
"addis RT, D(RA)" into the ELF format "addis RT, RA, SI".

bfd/
* reloc.c (BFD_RELOC_PPC_TOC16_HI, BFD_RELOC_PPC_TOC16_LO):
New relocations.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* coff-rs6000.c (xcoff_calculate_relocation): Call
xcoff_reloc_type_toc for R_TOCU and R_TOCL.
(xcoff_howto_table): Remove src_mask for TOC relocations.
Add R_TOCU and R_TOCL howtos.
(_bfd_xcoff_reloc_type_lookup): Add cases for
BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO.
(xcoff_reloc_type_toc): Compute the whole offset.
Implement R_TOCU and R_TOCL.
* coff64-rs6000.c (xcoff64_calculate_relocation):
Likewise.
(xcoff64_howto_table): Likewise.
(xcoff64_reloc_type_lookup): Likewise.
gas/
* config/tc-ppc.c (ppc_xcoff_suffix): New function.
(MAP, MAP32, MAP64): New macros for XCOFF.
(ppc_xcoff_fixup_addis): New function.
(ppc_is_toc_sym): Handle XMC_TE.
(fixup_size): Add cases for BFD_RELOC_PPC_TOC16_HI and
BFD_RELOC_PPC_TOC16_LO.
(md_assemble): Call ppc_xcoff_fixup_addis for XCOFF.
(ppc_change_csect): Handle XMC_TE.
(ppc_tc): Enable .tc symbols to have only a XMC_TC or XMC_TE
storage class.
(ppc_symbol_new_hook): Handle XMC_TE.
(ppc_frob_symbol): Likewise.
(ppc_fix_adjustable): Likewise.
(md_apply_fix): Handle BFD_RELOC_PPC_TOC16_HI and
BFD_RELOC_PPC_TOC16_LO.
ld/
* scripttempl/aix.sc: Add .te to .data section.
* testsuite/ld-powerpc/aix52.exp: Add test structure for AIX7+.
Add aix-largetoc-1 test.
* testsuite/ld-powerpc/aix-largetoc-1-32.d: New test.
* testsuite/ld-powerpc/aix-largetoc-1-64.d: New test.
* testsuite/ld-powerpc/aix-largetoc-1.ex: New test.
* testsuite/ld-powerpc/aix-largetoc-1.s: New test.
15 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/coff-rs6000.c
bfd/coff64-rs6000.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-ppc.c
ld/ChangeLog
ld/scripttempl/aix.sc
ld/testsuite/ld-powerpc/aix-largetoc-1-32.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/aix-largetoc-1-64.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/aix-largetoc-1.ex [new file with mode: 0644]
ld/testsuite/ld-powerpc/aix-largetoc-1.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/aix52.exp