This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: wrong section when using find_pc_section
- From: Tom Tromey <tromey at redhat dot com>
- To: freenix <van dot freenix at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 09 Aug 2013 12:27:33 -0600
- Subject: Re: wrong section when using find_pc_section
- References: <5204D68E dot 6060107 at gmail dot com>
>> I found that `disas` uses find_pc_section to locate the section which
>> contains the symbol passed to disas. It uses a bsearch function to do
>> the searching.
>> But if two sections are overlapped, find_pc_section can not correctly
>> return the section contains the address.
According at least to update_section_map, overlapping sections are
dropped from the map. The comment by filter_overlapping_sections seems
apropos:
/* Filter out overlapping sections, issuing a warning if any are found.
Overlapping sections could really be overlay sections which we didn't
classify as such in insert_section_p, or we could be dealing with a
corrupt binary. */
Tom