[PATCH v0 2/4] LoongArch: Do not emit relocation if addsy and subsy are in the same frag

Project / Subsystem

binutils / loongarch

Date

2026-07-07

Proposer

mengqinggang <mengqinggang@loongson.cn>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Consolidating instructions can improve code density and reduce relocation overhead.
  • Requires careful management of fragment boundaries and instruction types to ensure correctness.

All attributes

project
binutils
subsystem
loongarch
patch_id
discussion_id
20260707174719.1883721-3-mengqinggang@loongson.cn
source_type
public_inbox
title
[PATCH v0 2/4] LoongArch: Do not emit relocation if addsy and subsy are in the same frag
headline
LoongArch: Do not emit relocation if addsy and subsy are in the same frag
tldr
Optimizes LoongArch assembly by consolidating relaxed instructions and alignment nops within a single fragment, thus avoiding redundant relocations for addsy/s…
proposer
mengqinggang <mengqinggang@loongson.cn>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Consolidating instructions can improve code density and reduce relocation overhead.
  • Requires careful management of fragment boundaries and instruction types to ensure correctness.
series_id
binutils:loongarch: do not emit relocation if addsy and subsy are in the same frag
series_role
reply
series_parts
[]
tags
  • loongarch
  • binutils
  • assembler
  • linker
  • optimization
bugzilla_url
date
2026-07-07T00:00:00.000Z

[PATCH v0 2/4] LoongArch: Do not emit relocation if addsy and subsy are in the same frag

This patch modifies the LoongArch assembler to place relaxed instructions and alignment nops within the same fragment. Consequently, if addsy and subsy (likely related to symbol address calculations) reside in the same fragment, the assembler will not emit relocations for them, reducing overhead.