[PATCH] xtensa: add R_XTENSA_PDIFF_ULEB128 for DWARF uleb128 diffs

Project / Subsystem

binutils / xtensa

Date

2026-08-03

Proposer

Alexey Lapshin <alexey.lapshin@espressif.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Enables linker relaxation for functions with DWARF 5 debug info, potentially improving code size and performance.
  • • Introduces a new relocation type, increasing complexity in assembler and linker code.
  • • Falls back to `no_transform` for sleb128 and cross-section differences, and reports overflow for excessive growth.

All attributes

project
binutils
subsystem
xtensa
patch_id
—
discussion_id
7e22e4c80ad1779e1a6b57df2b8ef7272146037a.camel@espressif.com
source_type
public_inbox
title
[PATCH] xtensa: add R_XTENSA_PDIFF_ULEB128 for DWARF uleb128 diffs
headline
xtensa: add R_XTENSA_PDIFF_ULEB128 for DWARF uleb128 diffs
tldr
Introduces a new relocation type for Xtensa to better handle DWARF 5 uleb128 differences, enabling linker relaxation for functions with debug info.
proposer
Alexey Lapshin <alexey.lapshin@espressif.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Enables linker relaxation for functions with DWARF 5 debug info, potentially improving code size and performance.
  • • Introduces a new relocation type, increasing complexity in assembler and linker code.
  • • Falls back to `no_transform` for sleb128 and cross-section differences, and reports overflow for excessive growth.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • binutils
  • • gas
  • • xtensa
  • • relocation
  • • dwarf
bugzilla_url
—
date
2026-08-03T00:00:00.000Z

[PATCH] xtensa: add R_XTENSA_PDIFF_ULEB128 for DWARF uleb128 diffs

This patch introduces a new relocation type, R_XTENSA_PDIFF_ULEB128, for the Xtensa architecture to improve the handling of unsigned LEB128 (uleb128) differences in DWARF 5 debug information. Previously, DWARF 5’s use of uleb128 for symbol differences forced code containing this debug info to be marked no_transform, effectively disabling linker relaxation for nearly every function. The new relocation allows the linker to rewrite the padded uleb128 value in place after relaxation, thus enabling relaxation for functions with DWARF 5 debug info.