binutils Newspaper
NOVEMBER 30, 2026
m68hc11 — Proposed

m68hc11: return bool from relax delete helpers

M68HC11 linker relaxation now returns bool for delete helpers and propagates failures.

This patch updates the M68HC11 ELF relaxation functions, m68hc11_elf_relax_delete_bytes and m68hc11_relax_group, to return boolean values indicating success or failure. It integrates _bfd_elf_relax_delete_range_ok to validate deletion ranges and ensures that any deletion failures are propagated correctly within m68hc11_elf_relax_section.

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

    Modifies M68HC11 relaxation helpers to return boolean status and propagate errors.

    “Convert m68hc11_elf_relax_delete_bytes and m68hc11_relax_group to return bool. Validate deletion range with _bfd_elf_relax_delete_range_ok and propagate deletion failures in m68hc11_elf_relax_section.”

In Details

This change modifies the linker relaxation mechanism for the M68HC11 architecture within bfd/elf32-m68hc11.c. The functions responsible for deleting bytes (m68hc11_elf_relax_delete_bytes, m68hc11_relax_group) are updated to return a bool status. This allows m68hc11_elf_relax_section to properly detect and handle errors during deletion, incorporating checks from the new _bfd_elf_relax_delete_range_ok helper.

For Context
linker relaxation
A linker optimization process that adjusts instruction addresses and sizes at link time to improve code density or enable features like position-independent code. It may involve deleting or replacing instructions.
M68HC11
A member of the Motorola 68HC11 family of microcontrollers, for which the GNU toolchain provides support.
boolean
A data type that can have only one of two values, typically true or false. Used here to indicate success or failure of an operation.
Filed Under: linkerrelaxationm68hc11error handling