[PATCH 0/3] LoongArch: Optimize ADD/SUB and PC-relative relocations handling

Project / Subsystem

binutils / loongarch

Date

2026-08-13

Proposer

mengqinggang <mengqinggang@loongson.cn>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Improves efficiency and correctness of relocation handling for LoongArch.
  • • Adds complexity to assembler logic for handling various relocation types and expressions.

All attributes

project
binutils
subsystem
loongarch
patch_id
—
discussion_id
20260813170736.1880481-1-mengqinggang@loongson.cn
source_type
public_inbox
title
[PATCH 0/3] LoongArch: Optimize ADD/SUB and PC-relative relocations handling
headline
LoongArch: Optimize ADD/SUB and PC-relative relocations handling
tldr
Series optimizes LoongArch relocation handling for ADD/SUB and PC-relative types.
proposer
mengqinggang <mengqinggang@loongson.cn>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Improves efficiency and correctness of relocation handling for LoongArch.
  • • Adds complexity to assembler logic for handling various relocation types and expressions.
series_id
binutils:loongarch: optimize add/sub and pc-relative relocations handling
series_role
cover
series_parts
[]
tags
  • • loongarch
  • • assembler
  • • relocations
  • • optimization
  • • code generation
bugzilla_url
—
date
2026-08-13T00:00:00.000Z

[PATCH 0/3] LoongArch: Optimize ADD/SUB and PC-relative relocations handling

This patch series introduces several improvements to LoongArch relocation handling in the GNU Assembler. It adds support for emitting relocations for symbolic subtraction expressions, optimizes the TC_FORCE_RELOCATION_SUB_LOCAL mechanism to reduce fixup overhead, and corrects the md_pcrel_from function for accurate PC-relative offset calculations. These changes collectively aim to improve the efficiency and correctness of code generation for LoongArch.