public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "H. J. Lu" <hjl@lucon.org>
To: GDB <gdb@sources.redhat.com>
Subject: Re: Does gdb understand copy relocation?
Date: Sun, 07 Aug 2005 20:01:00 -0000	[thread overview]
Message-ID: <20050807200141.GA23363@lucon.org> (raw)
In-Reply-To: <20050807190859.GA17992@nevyn.them.org>

On Sun, Aug 07, 2005 at 03:08:59PM -0400, Daniel Jacobowitz wrote:
> On Sun, Aug 07, 2005 at 08:12:16AM -0700, H. J. Lu wrote:
> > On targets with copy relocation, when executable references a data
> > symbol defined in DSO, a copy relocation will be used to copy the
> > definition from DSO to executable and the copy in executable will be
> > used by the process. But gdb I am using insists using the one in DSO.
> > Is there a way to teach gdb about copy relocation?
> 
> GDB does not know anything about symbol resolution at all.  It also
> does not use the relocations for much of anything, just the symbol
> tables.
> 
> I would have expected it to prefer the copy in the executable.  I'm a
> bit surprised if it didn't.

There is no DW_AT_location for copy relocated symbol. But the symbol
tables have

    84: 080ebbd0     4 OBJECT  GLOBAL DEFAULT   24 optarg@GLIBC_2.0
(2)
  2297: 080ebbd0     4 OBJECT  GLOBAL DEFAULT   24 optarg@@GLIBC_2.0

If I strip the binary, gdb seems to know the location of optarg. I
think gdb should consult symbol tables in executable if the debug
info doesn't have DW_AT_location.



H.J.

      reply	other threads:[~2005-08-07 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-07 15:12 H. J. Lu
2005-08-07 19:09 ` Daniel Jacobowitz
2005-08-07 20:01   ` H. J. Lu [this message]

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=20050807200141.GA23363@lucon.org \
    --to=hjl@lucon.org \
    --cc=gdb@sources.redhat.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).