Landing: 0cdae10e5786

Project / Subsystem

binutils / binutils/bfd

Date

2026-08-02

Author

Alan Modra <amodra@sourceware.org>

Commit

0cdae10e5786da5d9128c9faaeb640130b041513

Source

public_inbox

Perf win

No

Breaking

No

All attributes

project
binutils
subsystem
binutils/bfd
patch_id
—
commit_hash
0cdae10e5786da5d9128c9faaeb640130b041513
source_type
public_inbox
headline
bfd: Fix memory corruption in ELF relocation handling
tldr
Fixes ELF relocation bug causing malloc/free corruption when linking objects with both REL and RELA relocations.
author
Alan Modra <amodra@sourceware.org>
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • binutils
  • • linker
  • • elf
  • • bugfix
discussion_id_link
—
bugzilla_pr
—
date
2026-08-02T00:00:00.000Z

A bug in _bfd_elf_link_read_relocs could lead to memory corruption, specifically malloc/free errors, when linking objects containing both REL and RELA relocations for the same section. This was caused by the REL relocation buffer being incorrectly reused for RELA relocations. The fix corrects the buffer handling and updates the function’s description, while also improving a test case to catch this issue.