Re: warning: (Internal error: pc 0xd00 in read in psymtab, but not in symtab.)

Jim Blandy
2005-11-15T23:10:57Z

On 11/15/05, Ron McCall <ronald.mccall@snet.net> wrote:
> I applied your patch to a pristine copy of gdb 6.3 and
> rebuilt and sure enough, that makes the warning go
> away! Should this patch get into the "real" gdb
> sources?

No; take a look at the comment above one of the sections commented out
by the patch:

/* When using the GNU linker, .gnu.linkonce. sections are used to
eliminate duplicate copies of functions and vtables and such.
The linker will arbitrarily choose one and discard the others.
The AT_*_pc values for such functions refer to local labels in
these sections. If the section from that file was discarded, the
labels are not in the output, so the relocs get a value of 0.
If this is a discarded function, mark the pc bounds as invalid,
so that GDB will ignore it. */

Fixing this entails some more reliable method of recognizing debug
info referring to functions or variables in deleted sections than what
we have now. Perhaps one of our linker fanatics knows of the Right
Way?

One possibility might be to tighten up the heuristic. Presumably, if
a function's low address is at zero because the function is really
located at the bottom of the address space, then its high address
won't be zero. But if the function was deleted, both the high and low
PC will be zero.