[PATCH] bfd: add missing smclass when creating csect for xcoff64
Alan Modra
amodra@gmail.com
Mon Feb 22 04:57:44 GMT 2021
On Tue, Feb 16, 2021 at 09:31:08AM +0000, CHIGOT, CLEMENT wrote:
> Hi Alan,
>
> > > This one is pretty simple, so I know that it won't change anyway.
> >
> > Maybe too simple. You've added new sections without handling them at
> > all in aix.sc, and in the case of .tl and .ul I'm fairly sure you will
> > need to add quite a lot of code for thread-local support. It is fine
> > to have small patches in a series, but this patch in isolation is
> > obviously incomplete.
> >
> > So I'd like to see a little more before committing the patch.
>
> Yes indeed, I've 6 patches coming up aiming to enable both TLS and large TOC
> (not -bbigtoc from AIX ld, but the TOC generated when -mcmodel=large is passed
> to gcc, making use of R_TOCU and R_TOCL relocations).
>
> I'll send them as a series.
OK, so the next question is whether you have a copyright assignment
agreement with the FSF for the binutils project? That is needed for
non-trivial contributions to binutils.
Also, I see
+FAIL: XCOFF TOC reloc test 1
+FAIL: PowerPC Test 1, 32 bit XCOFF
in the gas testsuite and
+FAIL: Object for --just-symbols test
in the ld testsuite with your patches applied.
The last one, a segmentation fault in your new code, is easy to fix.
Didn't you run the testsuite?
The first two are related to a change I made with commit 3b8b57a949,
selecting the reloc type earlier during insn parsing rather than later
in md_apply_reloc. Unfortunately that affected the powerpc xcoff
support with BFD_RELOC_16 not being changed to BFD_RELOC_PPC_TOC16 and
then _bfd_xcoff_reloc_type_lookup failing. That's the origin of this
code
case BFD_RELOC_16:
/* Note that this relocation is only internally used by gas. */
return &xcoff_howto_table[0xc];
which is wrong with your change to the howtos.
However, git commit 0e2779e98dc means that handling BFD_RELOC_16
in reloc_type_lookup is no longer needed. I'm going to apply the
following patch which will mean you don't need to worry about those
gas fails.
* coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Remove BFD_RELOC_16.
* coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index fbc1aed311..54fbf58e3a 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1092,9 +1092,6 @@ _bfd_xcoff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return &xcoff_howto_table[8];
case BFD_RELOC_PPC_TOC16:
return &xcoff_howto_table[3];
- case BFD_RELOC_16:
- /* Note that this relocation is only internally used by gas. */
- return &xcoff_howto_table[0xc];
case BFD_RELOC_PPC_B16:
return &xcoff_howto_table[0x1d];
case BFD_RELOC_32:
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 9aa0304ec9..98b0066822 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -1814,9 +1814,6 @@ xcoff64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return &xcoff64_howto_table[8];
case BFD_RELOC_PPC_TOC16:
return &xcoff64_howto_table[3];
- case BFD_RELOC_16:
- /* Note that this relocation is only internally used by gas. */
- return &xcoff64_howto_table[0xc];
case BFD_RELOC_PPC_B16:
return &xcoff64_howto_table[0x1e];
case BFD_RELOC_32:
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list