[PATCH] readelf: Don't dump GOT section after seeing error

H.J. Lu hjl.tools@gmail.com
Thu Aug 6 02:42:00 GMT 2026


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.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-readelf-Don-t-dump-GOT-section-after-seeing-error.patch
Type: text/x-patch
Size: 2918 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260806/afab7316/attachment.bin>


More information about the Binutils mailing list