[PATCH v3 1/4] microblaze: add BFD_RELOC_8 and BFD_RELOC_16 cases

Project / Subsystem

binutils / microblaze

Date

2026-09-24

Proposer

Sam Price <thesamprice@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Adds explicit handling for 8-bit and 16-bit relocations.
  • • Uses `md_number_to_chars` for consistent byte writing, simplifying the code.
  • • Fixes test cases and improves assembler robustness for MicroBlaze.

All attributes

project
binutils
subsystem
microblaze
patch_id
—
discussion_id
20260924014435.30185-2-thesamprice@gmail.com
source_type
public_inbox
title
[PATCH v3 1/4] microblaze: add BFD_RELOC_8 and BFD_RELOC_16 cases
headline
microblaze: add BFD_RELOC_8 and BFD_RELOC_16 cases
tldr
Adds support for 8-bit and 16-bit relocations in MicroBlaze's `md_apply_fix` function.
proposer
Sam Price <thesamprice@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Adds explicit handling for 8-bit and 16-bit relocations.
  • • Uses `md_number_to_chars` for consistent byte writing, simplifying the code.
  • • Fixes test cases and improves assembler robustness for MicroBlaze.
series_id
binutils:microblaze: add bfd_reloc_8 and bfd_reloc_16 cases
series_role
reply
series_parts
[]
tags
  • • microblaze
  • • gas
  • • relocation
  • • fixup
bugzilla_url
—
date
2026-09-24T00:00:00.000Z

[PATCH v3 1/4] microblaze: add BFD_RELOC_8 and BFD_RELOC_16 cases

This patch introduces support for BFD_RELOC_8 and BFD_RELOC_16 relocations within the MicroBlaze assembler’s md_apply_fix function. Previously, these relocation types were not handled, causing byte or halfword data that was only known at fixup time to be assembled as zero. This would then be resolved to BFD_RELOC_NONE, preventing the linker from correcting the value. The patch implements these cases using md_number_to_chars, which writes in the target’s byte order, thus fixing issues in the gas/all/simple-forward test and removing an xfail for gas/all/forward. The test suite results show an improvement in passing counts for both microblaze-elf and microblazeel-elf.