binutils Newspaper
OCTOBER 6, 2026
ld/microblaze — Proposed

ld/microblaze: don't index the local symbol cache with a global symbol index

Patch fixes an out-of-bounds read in microblaze ELF relaxation by adding a missing bounds check.

This patch addresses a bug in the microblaze ELF relaxation process where an out-of-bounds read could silently corrupt relocation addends. The issue stems from indexing the local symbol cache with a global symbol index without a proper bounds check, a guard that was present in the original code but dropped during a copy. The fix reintroduces this two-line guard, preventing incorrect adjustments to relocation addends and ensuring data integrity, as evidenced by passing new tests.

In the Thread 1 participant
  1. Neal Frager proposer

    Submits a patch to fix an out-of-bounds read in microblaze ELF relaxation by adding a missing bounds check.

    “microblaze_elf_relax_section() was copied from sh_elf_relax_delete_bytes() in 2009 (7ba29e2a41) but the copy dropped a bounds check that was already present in the sh original. This adds the missing two-line guard from bfd/elf32-sh.c:1227-1228, preventing an out-of-bounds read that silently corrupts relocation addends. The bug: when scanning relocations in other sections, the code indexes isymb…”