symbol versioning...

David Miller
Sat Nov 26 20:56:00 GMT 2011

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 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?

More information about the Gdb mailing list