A quick question about high/low_pc and linkonce sections
Jie Zhang
jzhang918@gmail.com
Fri Jul 1 10:13:00 GMT 2005
Hi,
This is a piece of code from dwarf2read.c, near the end of
dwarf2_get_pc_bounds ().
/* 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. */
if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0)
return 0;
Isn't "high == 0" much better than "low == 0"? It's possible that a
valid DW_AT_low_pc is 0.
Thanks,
Jie
More information about the Gdb
mailing list