public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* symbol versioning...
@ 2011-11-26 20:56 David Miller
  2011-11-26 21:11 ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-11-26 20:56 UTC (permalink / raw)
  To: gdb


I figured I'd ask about this here before I get too deep into trying
to fix this problem.

There are several test cases in the gdb suite which set a breakpoint
on 'printf' and then continue until it hits (f.e. annota1 and annota3).

These all fail on my sparc systems because my libc.so has two printf
symbols, each with a different ELF version.  The older version appears
first in the dynamic symbol table, so that's the one which GDB uses, and
it's therefore not the one the executable will actually call.

I can think of two ways to handle this:

1) Look in the executable for dynamic references to the given symbol,
   and record the symbol version, and this is the version we'll use when
   doing symbol lookups of that symbol.

2) Set the breakpoint in the PLT entry, and using target specific code
   that understands how the PLT hopping works, look at how the dynamic
   linker resolves the symbol and then record that in the minimal symbol
   table and elsewhere.

Has anyone else worked on trying to handle this properly?

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

* Re: symbol versioning...
  2011-11-26 20:56 symbol versioning David Miller
@ 2011-11-26 21:11 ` Jan Kratochvil
  2011-11-26 21:25   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2011-11-26 21:11 UTC (permalink / raw)
  To: David Miller; +Cc: gdb

On Sat, 26 Nov 2011 21:56:33 +0100, David Miller wrote:
> These all fail on my sparc systems because my libc.so has two printf
> symbols, each with a different ELF version.  The older version appears
> first in the dynamic symbol table, so that's the one which GDB uses, and
> it's therefore not the one the executable will actually call.

I should sometimes commit this patch:
	Re: [patch] Fix C++ demangling of minsyms with symver
	http://sourceware.org/ml/gdb-patches/2011-06/msg00045.html

Maybe implementing its part:
# One can see the default resolving to the @@ variant is not implemented.  Not
# sure if it should be but let that be a possible incremental patch in the
# future.

would solve this problem?



> I can think of two ways to handle this:

(3) With Tom Tromey's pending linespec patch GDB maybe could put a breakpoint
    on all the versions of such symbol.


Thanks,
Jan

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

* Re: symbol versioning...
  2011-11-26 21:11 ` Jan Kratochvil
@ 2011-11-26 21:25   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-11-26 21:25 UTC (permalink / raw)
  To: jan.kratochvil; +Cc: gdb

From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Sat, 26 Nov 2011 22:11:00 +0100

> On Sat, 26 Nov 2011 21:56:33 +0100, David Miller wrote:
>> These all fail on my sparc systems because my libc.so has two printf
>> symbols, each with a different ELF version.  The older version appears
>> first in the dynamic symbol table, so that's the one which GDB uses, and
>> it's therefore not the one the executable will actually call.
> 
> I should sometimes commit this patch:
> 	Re: [patch] Fix C++ demangling of minsyms with symver
> 	http://sourceware.org/ml/gdb-patches/2011-06/msg00045.html
> 
> Maybe implementing its part:
> # One can see the default resolving to the @@ variant is not implemented.  Not
> # sure if it should be but let that be a possible incremental patch in the
> # future.
> 
> would solve this problem?

Thanks a lot for the reference, I'll take a look!

>> I can think of two ways to handle this:
> 
> (3) With Tom Tromey's pending linespec patch GDB maybe could put a breakpoint
>     on all the versions of such symbol.

Even better :-)

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

end of thread, other threads:[~2011-11-26 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-26 20:56 symbol versioning David Miller
2011-11-26 21:11 ` Jan Kratochvil
2011-11-26 21:25   ` David Miller

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