--- ./gdb/dwarf2/read.c_orig 2026-03-29 22:52:24.050219167 -0500 +++ ./gdb/dwarf2/read.c 2026-03-29 22:58:15.127963799 -0500 @@ -7718,7 +7718,17 @@ create_dwo_unit_hash_tables (*dwo_file, *cu, section, ruh_kind::COMPILE); for (dwarf2_section_info §ion : dwo_file->sections.types) - create_dwo_unit_hash_tables (*dwo_file, *cu, section, ruh_kind::TYPE); + /* Create type hashes only if section has been read completely. + Otherwise for types like 'long' it would try to read it as 108(ascii l) + For example the the abbrev number created in abbreviation section + with xlc dwarf for c programs woth objdump --dwarf=info output would be. + <1><57>: Abbrev Number: 2 (DW_TAG_base_type) + <58> DW_AT_name : long long + <62> DW_AT_byte_size : 8 + <63> DW_AT_encoding : 5 (signed) + C++ program doesn't seem to have these kind of entries. */ + if (!section.empty() && section.readin) + create_dwo_unit_hash_tables (*dwo_file, *cu, section, ruh_kind::TYPE); dwarf_read_debug_printf ("DWO file found: %s", dwo_name);