public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Does gdb understand copy relocation?
@ 2005-08-07 15:12 H. J. Lu
  2005-08-07 19:09 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: H. J. Lu @ 2005-08-07 15:12 UTC (permalink / raw)
  To: GDB

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?


H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Does gdb understand copy relocation?
  2005-08-07 15:12 Does gdb understand copy relocation? H. J. Lu
@ 2005-08-07 19:09 ` Daniel Jacobowitz
  2005-08-07 20:01   ` H. J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-08-07 19:09 UTC (permalink / raw)
  To: H. J. Lu; +Cc: GDB

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.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Does gdb understand copy relocation?
  2005-08-07 19:09 ` Daniel Jacobowitz
@ 2005-08-07 20:01   ` H. J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H. J. Lu @ 2005-08-07 20:01 UTC (permalink / raw)
  To: GDB

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-07 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-07 15:12 Does gdb understand copy relocation? H. J. Lu
2005-08-07 19:09 ` Daniel Jacobowitz
2005-08-07 20:01   ` H. J. Lu

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).