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

Add r_ignore flag to COFF internal relocations

Introduces an `r_ignore` flag to the COFF internal relocation structure to allow backends to mark relocations as handled, preventing generic processing.

A new r_ignore bitfield has been added to the struct internal_reloc in COFF files, allowing backend functions to signal that they have already processed a relocation. This change also reorganizes related fields and modifies various backend and generic COFF functions to initialize the new flag and respect it during relocation processing. The generic relocation handling now skips entries marked with r_ignore.

In Details

This commit introduces the r_ignore bitfield to include/coff/internal.h's struct internal_reloc and modifies _bfd_coff_generic_relocate_section to respect it. Backend-specific relocation functions can now set r_ignore when they've handled a relocation, preventing the generic handler from re-processing it. This refactoring also includes minor adjustments to clearing and initialisation of internal_reloc fields in several *_ecoff_swap_reloc_in implementations to ensure consistency and correct usage of the new flag. The change aims to provide a cleaner mechanism for backends to indi…

For Context
COFF
Common Object File Format, a file format for object code used on many Unix-like systems. Binutils interacts with COFF files through its BFD library.
internal_reloc
A structure used internally by the BFD library to represent relocation information for COFF object files.
relocation
The process of updating symbolic references in object code to their final addresses when linking or loading. Relocations are instructions for the linker on how to modify addresses.
r_ignore
A new flag introduced to indicate that a relocation has already been handled by a specific backend function and should be skipped by generic processing.
backend
In the context of compilers and tools, a backend refers to the part of the system responsible for handling a specific target architecture or file format.
generic
Refers to code or functionality that is not specific to a particular architecture or system, but rather handles common cases.
Filed Under: binutilsbfdcoffrelocationrefactor