binutils Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
binutils/bfd

Fix segfault in coff-go32-exe PE parsing

Corrected BFD to properly handle coff-go32-exe files, preventing segfaults and incorrect format recognition.

A crash in _bfd_pe_print_private_bfd_data_common when processing coff-go32-exe files has been fixed. Changes in BFD altered the meaning of the bfd.offset field, causing misinterpretation of file structure for subsequent target matches. This led to assertions failing and segfaults. The fix introduces origin to struct bfd_preserve and ensures it’s saved and restored correctly, preventing BFD from misidentifying file formats and avoiding the crash.

In Details

Commit ac7113d5e2452c54c5de3c261f00b157ababbd51 addresses a bug in bfd/format.c affecting the coff-go32-exe format. Previously, bfd.offset was repurposed, leading to incorrect bfd_check_format behavior and a BFD_ASSERT in format.c:777. The fix adds an origin field to struct bfd_preserve and modifies bfd_preserve_save and bfd_preserve_restore to manage it. This prevents BFD from incorrectly matching against parts of the file after the Go32 stub and ensures correct format identification, resolving segfaults and ambiguity issues reported by oss-fuzz.

For Context
coff-go32-exe
A specific variant of the COFF executable file format used for DOS executables running under GO32 extenders.
PE
Portable Executable, a file format used for executables, object code, and DLLs on 32-bit and 64-bit versions of Windows.
BFD
The Binary File Descriptor library, a generic interface for handling various object file formats.
bfd.offset
A field within the BFD structure that traditionally represented an offset within an archive. Its meaning was changed, leading to misinterpretations for certain file formats.
segfault
A segmentation fault, an error that occurs when a program accesses a memory location that it is not allowed to access.
Filed Under: binutilsbfdcoffPEcrash fix