Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Modra via Gdb-patches <gdb-patches@sourceware.org>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Cc: rogerio <rogealve@br.ibm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [Patch v2] Handle .TOC. sections during gdb-compile for rs6000 target.
Date: Thu, 29 Jul 2021 17:56:11 +0930	[thread overview]
Message-ID: <YQJmI6dC7tzN8XYB@squeak.grove.modra.org> (raw)
In-Reply-To: <OF78EDB233.0582DEBF-ONC1258721.00280644-C1258721.002820D8@ibm.com>

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.

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2021-07-29  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 19:08 will schmidt via Gdb-patches
2021-07-29  7:18 ` Ulrich Weigand via Gdb-patches
2021-07-29  8:26   ` Alan Modra via Gdb-patches [this message]
2021-07-29 11:49     ` Ulrich Weigand via Gdb-patches
2021-08-05 17:50       ` will schmidt via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YQJmI6dC7tzN8XYB@squeak.grove.modra.org \
    --to=gdb-patches@sourceware.org \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=amodra@gmail.com \
    --cc=rogealve@br.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox