https://sourceware.org/gdb/current/onlinedocs/gdb.html/Index-Section-Format.html Version 9 adds the name and the language of the main function to the index.
Created attachment 15694 [details] Initial patch to improve error/warning messages and support version 9 .gdb_index
headersize = ver < 9 ? 0x18 : 0x1c; The comment says the difference is 2 * 4 bytes, but the above difference is just 4 bytes.
(In reply to Jakub Jelinek from comment #2) > headersize = ver < 9 ? 0x18 : 0x1c; > > The comment says the difference is 2 * 4 bytes, but the above difference is > just 4 bytes. You are right. The comment is confusing, I'll fix it. The header is increased by 4 bytes, which is the offset to the new table. The table content itself is 2 * 4 bytes.
https://inbox.sourceware.org/dwz/20241002224422.763202-1-mark@klomp.org/
commit 1ae37f476bc6c9f7a756fee4830766f03600866c Author: Mark Wielaard <mark@klomp.org> Date: Wed Oct 2 23:20:57 2024 +0200 Add support for version 9 .gdb_index Version 9 .gdb_index adds a new shortcut table. The table itself is just two offset_type values (2 * 4 bytes) describing the language of the main function expresses as an DW_LANG_ constant and the offset of the main function's name in the constant pool. The offset to the shortcut table in the header is between the symbol table and constant pool offsets. write_gdb_index explicitly copies the function's name into the new constant pool (if lang is not zero) because it might not be an offset to an existing name of a symbol. Some extra checks and warnings have been added to let the user know when parsing the .gdb_index fails. Add a const char *file argument to write_gdb_index for better error reporting. Add -D_GNU_SOURCE to Makefile CFLAGS_COMMON to use memrchr. This fixes the gdb-add-index.sh testcase with gdb 15+. https://sourceware.org/bugzilla/show_bug.cgi?id=32146
*** Bug 32028 has been marked as a duplicate of this bug. ***