Re: [PATCH] AArch64: Optimize ADD relocations that resolve to zero

Project / Subsystem

binutils / aarch64

Date

2026-08-13

Proposer

Alice Carlotti <alice.carlotti@arm.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Performing the optimization improves code density and potentially performance but risks correctness if relocations are still active.
  • • Adding checks for relocation status increases complexity in the linker.

All attributes

project
binutils
subsystem
aarch64
patch_id
—
discussion_id
cc2a28f2-e71d-9054-4e42-c61a8b772668@e124511.cambridge.arm.com
source_type
public_inbox
title
Re: [PATCH] AArch64: Optimize ADD relocations that resolve to zero
headline
AArch64 ADD relocation optimization invalid with pending relocations
tldr
Reviewer flags that optimizing ADD instructions to MOV/NOP when relocations resolve to zero is invalid if the linker still emits relocations, as it breaks idem…
proposer
Alice Carlotti <alice.carlotti@arm.com>
consensus
Proposed
outcome
needs_revision
sentiment_score
—
technical_tradeoffs
  • • Performing the optimization improves code density and potentially performance but risks correctness if relocations are still active.
  • • Adding checks for relocation status increases complexity in the linker.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • ld
  • • aarch64
  • • optimization
  • • relocation
  • • review
bugzilla_url
—
date
2026-08-13T00:00:00.000Z

Re: [PATCH] AArch64: Optimize ADD relocations that resolve to zero

A reviewer has raised a concern regarding a proposed optimization for AArch64 ADD instructions. The optimization replaces ADD instructions whose immediate value becomes zero after relocation with MOV or NOP instructions. The reviewer argues this is invalid if the linker continues to emit relocations for these instructions, as it breaks idempotency. Further clarification from maintainers is requested on how to check for this condition.