THURSDAY, AUGUST 6, 2026
binutils/readelf
Prevent GOT section dump on readelf errors.
readelf now avoids dumping GOT section contents if errors are encountered during file processing.
The readelf utility will no longer dump the GOT (Global Offset Table) section if errors are detected during the parsing of an ELF file. This change prevents potentially misleading or corrupt output when the input file has structural issues.
In Details
This commit introduces error tracking (seen_error, seen_elf_error, clear_elf_error) in elfcomm.c and elfcomm.h. The error function now sets seen_error to true. Subsequently, process_got_section_contents in readelf.c returns early if seen_elf_error is true, preventing the dumping of GOT section data after an error has occurred. This addresses PR binutils/34473.
For Context
- readelf
- A command-line utility that displays information about ELF (Executable and Linkable Format) files.
- GOT
- Global Offset Table. A special section in position-independent code (PIC) executables and shared libraries used to indirectly reference global and static variables.
- ELF
- Executable and Linkable Format. A standard file format for executables, object code, shared libraries, and core dumps on many Unix-like systems.
- PR binutils/34473
- A specific bug report filed against the Binutils project, identified by its number (34473).