forked from Imagelibrary/binutils-gdb
Fixes part of a problem reading deliberately non-conforming ELF binaries - where a
note segment is present but no note section. * readelf.c (process_note_sections): If there are no note sections try processing note segments instead.
This commit is contained in:
@@ -14050,15 +14050,23 @@ process_note_sections (FILE * file)
|
||||
{
|
||||
Elf_Internal_Shdr * section;
|
||||
unsigned long i;
|
||||
int n = 0;
|
||||
int res = 1;
|
||||
|
||||
for (i = 0, section = section_headers;
|
||||
i < elf_header.e_shnum && section != NULL;
|
||||
i++, section++)
|
||||
if (section->sh_type == SHT_NOTE)
|
||||
res &= process_corefile_note_segment (file,
|
||||
(bfd_vma) section->sh_offset,
|
||||
(bfd_vma) section->sh_size);
|
||||
{
|
||||
res &= process_corefile_note_segment (file,
|
||||
(bfd_vma) section->sh_offset,
|
||||
(bfd_vma) section->sh_size);
|
||||
n++;
|
||||
}
|
||||
|
||||
if (n == 0)
|
||||
/* Try processing NOTE segments instead. */
|
||||
return process_corefile_note_segments (file);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user