Landing: d00c5ac412d1

Project / Subsystem

binutils / sh

Date

2026-10-01

Author

Alan Modra <amodra@sourceware.org>

Commit

d00c5ac412d1b1babb2d4ac071028d498986b413

Source

public_inbox

Perf win

No

Breaking

No

All attributes

project
binutils
subsystem
sh
patch_id
—
commit_hash
d00c5ac412d1b1babb2d4ac071028d498986b413
source_type
public_inbox
headline
Prefer targets with more sections when resolving core file formats
tldr
Binutils now prioritizes SH core file targets with more sections to ensure correct register information is parsed.
author
Alan Modra <amodra@sourceware.org>
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • core dump
  • • debugger
  • • sh
  • • bugfix
discussion_id_link
public_inbox:binutils#34676
bugzilla_pr
—
date
2026-10-01T00:00:00.000Z

This patch improves core file support for SH targets by modifying bfd_check_format_matches. When multiple targets have equivalent matching scores, the function now prefers targets that define a higher number of sections. This is crucial for SH Linux core files, where only a specific target (elf32-sh-linux) correctly interprets NT_PRSTATUS notes and generates the necessary .reg section for registers.