binutils Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
readelf

readelf: Save and dump original section header values.

readelf now saves and displays original section header values, fixing potential buffer overflow and improving error handling.

readelf now saves and displays the original section header values, which was previously missing. This change addresses a potential buffer overflow vulnerability in free_filedata by ensuring proper allocation and handling of section header data. It also improves error reporting for memory allocation failures.

In Details

The readelf tool's save_original_section_header_values function now uses xmalloc and handles potential allocation failures more robustly. The logic in validate_section_info and the section header fetching functions (get_32bit_section_headers, get_64bit_section_headers) has been refined to avoid issues during probing and to prevent arithmetic overflow when checking section sizes, particularly when dealing with RELR entries.

For Context
readelf
A utility to display information about ELF (Executable and Linkable Format) files, including section headers, symbols, and relocation information.
ELF
Executable and Linkable Format. A common file format for executables, object code, shared libraries, and core dumps on Unix-like systems.
section header
Metadata within an ELF file that describes each section, including its type, location, size, and other properties. readelf displays this information.
buffer overflow
A condition where a program attempts to write data beyond the allocated buffer, potentially corrupting adjacent memory or causing crashes.
RELR
A type of relocation entry used in ELF files for a linked-in dynamic library. It's used to link symbols used by the dynamic linker.
Filed Under: readelfELFsecurityerror handling