[Patch v2] Handle .TOC. sections during gdb-compile for rs6000 target.
will schmidt
will_schmidt@vnet.ibm.com
Thu Aug 5 17:50:09 GMT 2021
On Thu, 2021-07-29 at 13:49 +0200, Ulrich Weigand wrote:
> "Alan Modra" <amodra@gmail.com> wrote on 29.07.2021 10:26:11:
> > On Thu, Jul 29, 2021 at 09:18:18AM +0200, Ulrich Weigand wrote:
> > >
> > >
> > > "will schmidt" <will_schmidt@vnet.ibm.com> wrote on 28.07.2021
> 21:08:21:
> > >
> > > > + sym->section = toc_fallback;
> > > > + sym->value = 0x8000;
> > > > + bfd_set_gp_value(abfd.get(), toc_fallback->vma);
> > >
> > > For compatibility with BFD, shouldn't this be rather:
> > >
> > > bfd_set_gp_value(abfd.get(), toc_fallback->vma + sym-
> >value);
> > >
> > > Alan, can you confirm?
> >
> > No, see bfd/elf64-ppc.c:ppc64_elf_sec_toc. A long time ago I chose
> > the value of elf_gp used in elf64-ppc.c to be the start of the toc
> > section rather than the value of ".TOC.". The value is somewhat
> > arbitrary. Yes, I could change it to be the value of .TOC., but
> for
> > now the value above is correct.
>
> I see, thanks for the explanation.
>
> Will, the patch is OK for trunk then.
Committed with some additional indentation and cosmetic tweaks,
Thanks
-WIll
>
> Thanks,
> Ulrich
>
>
More information about the Gdb-patches
mailing list