This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
symbol versioning...
- From: David Miller <davem at davemloft dot net>
- To: gdb at sourceware dot org
- Date: Sat, 26 Nov 2011 15:56:33 -0500 (EST)
- Subject: symbol versioning...
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?