[PATCH] readelf: Don't dump GOT section after seeing error
Jan Beulich
jbeulich@suse.com
Thu Aug 6 06:03:11 GMT 2026
On 06.08.2026 04:42, H.J. Lu wrote:
> Don't dump GOT section contents after seeing errors in input:
>
> readelf: Error: Section 10 has invalid sh_entsize of 0
> readelf: Error: (Using the expected size of 18 for the rest of this dump)
> readelf: Error: Too many program headers - 0x3030 - the file is not that big
>
> PR binutils/34473
> * elfcomm.c (seen_error): New.
> (seen_elf_error): Likewise.
> (clear_elf_error): Likewise.
> (error): Set seen_error to true.
> * elfcomm.h (seen_elf_error): New.
> (clear_elf_error): Likewise.
> * readelf.c (process_got_section_contents): Return false if
> seen_elf_error returns true.
> (main): Call clear_elf_error before calling process_file.
Okay. And this model may want widening to elsewhere, not limited to readelf.
Jan
More information about the Binutils
mailing list