Re: [patch] AVR: Let -mrelax elide global RJMP .+0

Project / Subsystem

binutils / avr

Date

2026-09-02

Proposer

Georg-Johann Lay <avr@gjlay.de>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Potential for increased code size if the elision is incorrect in edge cases, though tests passed.
  • • Adds a new command-line option (--no-elide-rjmp0) for fine-grained control.

All attributes

project
binutils
subsystem
avr
patch_id
—
discussion_id
22920702-1e43-4045-bc1d-45bcdd804cc4@gjlay.de
source_type
public_inbox
title
Re: [patch] AVR: Let -mrelax elide global RJMP .+0
headline
AVR: Let -mrelax elide global RJMP .+0
tldr
Allow the AVR linker's relaxation to elide RJMP instructions targeting global symbols.
proposer
Georg-Johann Lay <avr@gjlay.de>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Potential for increased code size if the elision is incorrect in edge cases, though tests passed.
  • • Adds a new command-line option (--no-elide-rjmp0) for fine-grained control.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • avr
  • • linker
  • • optimization
  • • relaxation
bugzilla_url
—
date
2026-09-02T00:00:00.000Z

Re: [patch] AVR: Let -mrelax elide global RJMP .+0

This patch extends the AVR linker’s relaxation capabilities to elide RJMP instructions that jump to a global symbol with a zero offset. This optimization is useful in scenarios like tail-calling functions where the called function immediately follows the caller. A new option, —no-elide-rjmp0, is introduced to disable this feature. The patch has been tested and approved.