readelf: don't clear section_headers in process_file_header

* readelf.c (process_file_header): Don't clear section_headers.
This commit is contained in:
Alan Modra 2021-06-12 11:59:22 +09:30
parent e331b18d42
commit 8c60e272c7
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2021-06-12 Alan Modra <amodra@gmail.com>
* readelf.c (process_file_header): Don't clear section_headers.
2021-06-12 Alan Modra <amodra@gmail.com>
* readelf.c (get_section_headers): Don't test e_shoff here, leave

View File

@ -5237,8 +5237,6 @@ process_file_header (Filedata * filedata)
header->e_shstrndx = filedata->section_headers[0].sh_link;
if (header->e_shstrndx >= header->e_shnum)
header->e_shstrndx = SHN_UNDEF;
free (filedata->section_headers);
filedata->section_headers = NULL;
}
return true;