From c5df7e442e6cdc9303b7373842370d6ee8f67ea5 Mon Sep 17 00:00:00 2001 From: Cl?ment Chigot Date: Tue, 20 Apr 2021 14:40:43 +0100 Subject: Rework the R_NEG support on both gas and ld for the PowerPC AIX targets, in order to manage C++ exceptions built with GCC. bfd PR binutils/21700 * reloc.c (BFD_RELOC_PPC_NEG): New relocation. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Add BFD_RELOC_PPC_NEG handler. (xcoff_reloc_type_neg): Correctly substract addend. * coff64-rs6000.c (xcoff64_howto_table): Add R_NEG_32 howto. (xcoff64_rtype2howto): Add handler for R_NEG_32. (xcoff64_reloc_type_lookup): Add BFD_RELOC_PPC_NEG handler. * xcofflink.c (xcoff_need_ldrel_p): Check output section for R_POS-like relocations. New argument added. (xcoff_mark): Adapt to new xcoff_need_ldrel_p argument. (xcoff_link_input_bfd): Likewise. gas * config/tc-ppc.c (ppc_get_csect_to_adjust): New function. (ppc_fix_adjustable): Manage fx_subsy part. (tc_gen_reloc): Create second relocation when both fx_addsy and fx_subsy are provided. * config/tc-ppc.h (RELOC_EXPANSION_POSSIBLE): New define. (MAX_RELOC_EXPANSION): Likewise. (TC_FORCE_RELOCATION_SUB_SAME): Likewise (UNDEFINED_DIFFERENCE_OK): Likewise * testsuite/gas/all/gas.exp: Skip difference between two undefined symbols test. ld * testsuite/ld-powerpc/aix52.exp: Add new test. * testsuite/ld-powerpc/aix-neg-reloc-32.d: New test. * testsuite/ld-powerpc/aix-neg-reloc-64.d: New test. * testsuite/ld-powerpc/aix-neg-reloc.ex: New test. * testsuite/ld-powerpc/aix-neg-reloc.s: New test. --- bfd/ChangeLog | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bfd/ChangeLog') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 513d6e9..972311b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,21 @@ +2021-04-20 Clément Chigot + + PR binutils/21700 + * reloc.c (BFD_RELOC_PPC_NEG): New relocation. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Add + BFD_RELOC_PPC_NEG handler. + (xcoff_reloc_type_neg): Correctly substract addend. + * coff64-rs6000.c (xcoff64_howto_table): Add R_NEG_32 + howto. + (xcoff64_rtype2howto): Add handler for R_NEG_32. + (xcoff64_reloc_type_lookup): Add BFD_RELOC_PPC_NEG handler. + * xcofflink.c (xcoff_need_ldrel_p): Check output section + for R_POS-like relocations. New argument added. + (xcoff_mark): Adapt to new xcoff_need_ldrel_p argument. + (xcoff_link_input_bfd): Likewise. + 2021-04-16 Alan Modra PR 27567 -- cgit v1.1