Re: [PATCH] [dwarf2read] Fix crash when loading dwp files: calculate num_sections based on actual section indices, not just the number of sections.

Tom Tromey
2019-02-26T15:08:54Z

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

>> - dwp_file->num_sections = bfd_count_sections (dwp_file->dbfd) + 1;
>> + dwp_file->num_sections = elf_numsections (dwp_file->dbfd);

Simon> I have tweaked the original commit message a bit and pushed.
Simon> Thanks again for the patch.

I wonder if there's any way to reach this with a non-ELF objfile --
Mach-O seems probable. I think we also handle DWARF on AIX (ECOFF IIRC)
but I don't know if that does dwp.

Tom