[PATCH v0 3/4] LoongArch: Emit fewer relocations for label subtraction

Project / Subsystem

binutils / loongarch

Date

2026-07-07

Proposer

mengqinggang <mengqinggang@loongson.cn>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Reduced relocations can lead to smaller object files and faster linking, but requires accurate tracking of instruction states.
  • The logic for identifying 'relaxed' instructions needs to be comprehensive and correct for the optimization to be safe.

All attributes

project
binutils
subsystem
loongarch
patch_id
discussion_id
20260707174719.1883721-4-mengqinggang@loongson.cn
source_type
public_inbox
title
[PATCH v0 3/4] LoongArch: Emit fewer relocations for label subtraction
headline
LoongArch: Emit fewer relocations for label subtraction
tldr
Optimizes LoongArch instruction emission by not generating relocations for label subtraction when no relaxed instructions are present between addsy and subsy.
proposer
mengqinggang <mengqinggang@loongson.cn>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Reduced relocations can lead to smaller object files and faster linking, but requires accurate tracking of instruction states.
  • The logic for identifying 'relaxed' instructions needs to be comprehensive and correct for the optimization to be safe.
series_id
binutils:loongarch: emit fewer relocations for label subtraction
series_role
reply
series_parts
[]
tags
  • loongarch
  • binutils
  • linker
  • optimization
  • compiler
bugzilla_url
date
2026-07-07T00:00:00.000Z

[PATCH v0 3/4] LoongArch: Emit fewer relocations for label subtraction

This patch for the LoongArch binutils component optimizes relocation emission for label subtraction. It introduces flags to mark fragments and sections with relaxed instructions, preventing the generation of relocations when addsy and subsy occur within the same fragment and no relaxed instructions are interspersed.