binutils Newspaper
NOVEMBER 30, 2026
binutils/ft32 — Proposed

ft32: Fix error path in relax_section to return false

Corrects an error handling bug in the ft32 linker relaxation process.

This patch corrects an error in the ft32_elf_relax_section function within the binutils ft32 target. Previously, the error_return block incorrectly returned true, masking failures such as read errors, symbol issues, or relocation problems as successes. This allowed relaxation to continue with corrupted state. The fix changes the error return value to false, ensuring that errors during relaxation are properly reported.

In the Thread 2 participants
  1. Harshit Kumar <harshit7kr@gmail.com> proposer

    Submits a patch to fix an error return value in the ft32 relaxation process.

    “In ft32_elf_relax_section, the error_return: block returned true, so failures to read the section contents, local symbols or relocations, and failures from elf32_ft32_relax_delete_bytes, were reported as success and relaxation continued with corrupt state. Correct error_return: to return false. Signed-off-by: Harshit Kumar <harshit7kr@gmail.com>”
  2. Jan Beulich <jbeulich@suse.com> reviewer

    Acknowledges and accepts the proposed fix.

    “Okay.”

Technical Tradeoffs

  • Fixes a bug in error reporting, improving the robustness of the linker's relaxation process for the ft32 target.

In Details

The ft32 target in binutils has a relaxation function, ft32_elf_relax_section, where the error handling path was faulty. Specifically, the error_return label incorrectly returned true, indicating success even when underlying operations like section content reading, local symbol processing, or relocation handling (including elf32_ft32_relax_delete_bytes) failed. This led to corrupted state during relaxation. This patch corrects the return value in the error path to false, aligning it with the expected behavior for signaling failure.

For Context
ft32
Likely refers to a specific target architecture or instruction set for which binutils provides support, possibly related to Fujitsu's FR or similar architectures.
linker relaxation
A linker optimization process where certain instructions or data references are adjusted (e.g., changing absolute addresses to PC-relative offsets) to improve code density or enable position-independent execution. This often involves multiple passes.
section
A part of an object file or executable that contains related data, such as code (.text), initialized data (.data), or uninitialized data (.bss).
relocations
Information in an object file that tells the linker how to modify addresses when combining object files, for example, to handle position-independent code or absolute addressing.

Part of a Series

Filed Under: binutilslinkerft32error handling