This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
A quick question about high/low_pc and linkonce sections
- From: Jie Zhang <jzhang918 at gmail dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 1 Jul 2005 18:13:23 +0800
- Subject: A quick question about high/low_pc and linkonce sections
- Reply-to: Jie Zhang <jzhang918 at gmail dot com>
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