binutils Newspaper
OCTOBER 6, 2026
bfd — Proposed

bfd: SEC_DEBUGGING in bfd_generic_get_relocated_section_contents()

Fixes binutils BFD to correctly handle debugging sections during relocation processing.

This patch corrects a regression in binutils’ BFD library where debugging sections were incorrectly excluded during relocation processing. The exclusion, introduced in a previous change, led to broken debug info and testsuite failures. The fix ensures these sections are handled appropriately, resolving issues that became more apparent with recent readelf/objdump improvements.

In Details

A recent change in BFD's ELF merge logic (bfd_generic_get_relocated_section_contents) inadvertently excluded debugging sections (marked with SEC_DEBUGGING) from relocation processing. This patch aims to correct that by re-evaluating the handling of these sections. The author notes that a blanket exclusion was wrong and discusses the need for specific handling, similar to how other sections are processed, while also considering potential issues with non-section symbols.

For Context
BFD
Binary File Descriptor library, a backend API for accessing object file formats.
SEC_DEBUGGING
A flag within the BFD library indicating that a section contains debugging information.
relocation
The process of updating symbolic references in relocatable object code to absolute symbols, typically done by the linker.
debug info
Metadata embedded in an object file that allows debuggers to map machine code back to source code constructs (variables, functions, line numbers).
readelf
A utility that displays information about ELF (Executable and Linkable Format) files.
objdump
A utility that displays information from object files, including disassembled code.
Filed Under: bugfixlinkerdebuginfo