]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix use of "main" marker in gdb index
authorTom Tromey <tom@tromey.com>
Mon, 22 Sep 2025 15:08:46 +0000 (09:08 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 14 Oct 2025 16:18:09 +0000 (10:18 -0600)
commitf283e80fed61096b39c17dc325ad13926aaafef0
tree64c94d658ca25b9e6418f284e754c40869c6856f
parent94a0adaca0c84c645acc45e28662a4cbaeb75fbe
Fix use of "main" marker in gdb index

Tom de Vries noticed that with .gdb_index, the "main" marker would
sometimes seemingly be ignored.

I tracked this down to an interaction between the rewritten reader and
the "main"-finding code in cooked_index.  With the ordinary DWARF
scanner, a C "main" won't be marked as IS_MAIN; whereas with
.gdb_index this can happen.  In this case, the code thinks that C
requires canonicalization (which is only true for types), and skips
using the symbol.

This patch fixes the problem and adds some comments explaining what is
going on.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33441
gdb/dwarf2/cooked-index-shard.c
gdb/dwarf2/cooked-index.c