+2023-10-24 Tom de Vries <tdevries@suse.de>
+
+ * dwarf.c (display_gdb_index): Handle unknown name of main.
+
2023-10-10 Tom de Vries <tdevries@suse.de>
* dwarf.c (display_lang): New function, factored out of ...
display_lang (lang);
printf ("\n");
- uint32_t name_offset = byte_get_little_endian (shortcut_table + 4, 4);
printf (_("Name of main: "));
- if (name_offset >= section->size - constant_pool_offset)
+ if (lang == 0)
+ printf (_("<unknown>\n"));
+ else
{
- printf (_("<corrupt offset: %x>\n"), name_offset);
- warn (_("Corrupt name offset of 0x%x found for name of main\n"),
- name_offset);
+ uint32_t name_offset = byte_get_little_endian (shortcut_table + 4, 4);
+ if (name_offset >= section->size - constant_pool_offset)
+ {
+ printf (_("<corrupt offset: %x>\n"), name_offset);
+ warn (_("Corrupt name offset of 0x%x found for name of main\n"),
+ name_offset);
+ }
+ else
+ printf ("%s\n", constant_pool + name_offset);
}
- else
- printf ("%s\n", constant_pool + name_offset);
}
return 1;