binutils Newspaper
NOVEMBER 30, 2026
bfd/x86 — Proposed

bfd/x86: Fix handling of secondary relocations on objcopy/strip

Fixes silent corruption of secondary relocations by objcopy and strip, restoring expected behavior.

This series addresses a bug where secondary relocations in ‘.klp.rela.*’ sections were silently corrupted by both the strip and objcopy utilities. The proposed patches aim to restore the original, correct behavior for handling these relocations.

In the Thread 1 participant
  1. Antoine Damhet <adamhet@scaleway.com> proposer

    Submits a two-part patch series to fix corruptions in secondary relocations affecting objcopy and strip utilities.

    “As outlined in the bug[1], relocations of '.klp.rela.*' sections would be silently corrupted by both strip and objcopy. This series restore the original behavior for both regressions.”

In Details

This patch series targets the BFD (Binary File Descriptor) library and its x86-specific ELF backend. It corrects issues with handling secondary relocations (likely related to livepatching mechanisms like '.klp.rela.*' sections) when these sections are processed by objcopy or strip. The fix appears to involve ensuring correct copying of section metadata, preventing data corruption.

For Context
relocations
Information in an object file that describes how to modify memory addresses when the code or data is linked or loaded into memory. Secondary relocations might refer to relocations that are dependent on other relocations or are part of a more complex linking process.
objcopy
A utility in GNU Binutils that copies and translates object files. It can be used to remove or modify sections, change symbol names, etc.
strip
A utility in GNU Binutils that removes symbols and other information from object files to reduce their size.
bfd
The Binary File Descriptor library, a core component of GNU Binutils that provides a device-independent interface to a variety of object file formats.
SHT_SECONDARY_RELOC
A section type in the ELF file format that indicates secondary relocation information, often used in specific linking or patching scenarios.
Filed Under: binutilsbfdx86objcopystrip