]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/objfiles.c
gdb: Do not add empty sections to the section map
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 1 Jun 2022 12:04:10 +0000 (14:04 +0200)
committerIlya Leoshkevich <iii@linux.ibm.com>
Thu, 2 Jun 2022 12:20:05 +0000 (14:20 +0200)
commit625b6eae091709b95471eae92d42dc6bc71e6553
tree94e4cb87ab7da873d4589df2d37d1362e208ea0d
parenta7790128481894630414213603d3e894d764f802
gdb: Do not add empty sections to the section map

From: Ulrich Weigand <ulrich.weigand@de.ibm.com>

build_objfile_section_table () creates four synthetic sections per
objfile, which are collected by update_section_map () and passed to
std::sort ().  When there are a lot of objfiles, for example, when
debugging JITs, the presence of these sections slows down the sorting
significantly.

The output of update_section_map () is used by find_pc_section (),
which can never return any of these sections: their size is 0, so they
cannot be accepted by bsearch_cmp ().

Filter them (and all the other empty sections) out in
insert_section_p (), which is used only by update_section_map ().
gdb/objfiles.c