public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: will schmidt <will_schmidt@vnet.ibm.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
	gdb-patches@sourceware.org, rogerio <rogealve@br.ibm.com>,
	"Carl E. Love" <cel@us.ibm.com>
Subject: Re: gdb compile for powerpc64 target - Could not find symbol ".TOC."
Date: Sat, 10 Jul 2021 10:31:40 +0930	[thread overview]
Message-ID: <YOjxdOaP6uy4i8tU@squeak.grove.modra.org> (raw)
In-Reply-To: <7a410f448ecddd3e5c4175344be639f68ab3be47.camel@vnet.ibm.com>

On Fri, Jul 09, 2021 at 11:51:35AM -0500, will schmidt wrote:
> I've made some local changes so I'm now calling bfd_set_gp_value when
> the ".TOC." symbol is handled in compile_object_load. 
> i.e. 
>       if (strcmp (sym->name, ".TOC.") == 0)
>         bfd_set_gp_value(abfd.get(), sym->value);
> 
> This is either wrong, or insufficient.  :-)

Symbol value here is section relative.  You need to add the symbol
section vma, which is set by setup_sections_data::setup_one_section.

If that doesn't help, I would run gdb under gdb with a breakpoint on
ppc64_elf_toc_reloc looking to see whether that function is using the
value you expect given your bfd_set_gp_value call.

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2021-07-10  1:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 18:54 will schmidt
2021-06-23 15:36 ` Ulrich Weigand
2021-06-23 17:37   ` will schmidt
2021-06-24  3:11     ` Alan Modra
2021-06-24  4:39       ` Alan Modra
2021-06-24 15:32       ` Ulrich Weigand
2021-06-24 23:05         ` Alan Modra
2021-06-25 14:49           ` will schmidt
2021-07-09 16:51           ` will schmidt
2021-07-10  1:01             ` Alan Modra [this message]
2021-07-13  4:33               ` will schmidt
2021-07-13 11:11                 ` Alan Modra
2021-07-13 22:59                   ` will schmidt

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=YOjxdOaP6uy4i8tU@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=cel@us.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=rogealve@br.ibm.com \
    --cc=uweigand@de.ibm.com \
    --cc=will_schmidt@vnet.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).