[PATCH] LoongArch: fix .got.plt dislocation in static PDE

Project / Subsystem

binutils / loongarch

Date

2026-08-02

Proposer

Xi Ruoyao <xry111@xry111.site>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Correcting miscalculation of .got.plt addresses ensures proper dynamic linking behavior.
  • • Refactoring code improves maintainability and reduces the risk of similar bugs.
  • • Ensuring static linking scenarios are handled correctly alongside dynamic ones.

All attributes

project
binutils
subsystem
loongarch
patch_id
—
discussion_id
20260802040719.1136959-1-xry111@xry111.site
source_type
public_inbox
title
[PATCH] LoongArch: fix .got.plt dislocation in static PDE
headline
LoongArch: fix .got.plt dislocation in static PDE
tldr
Fixes an issue in LoongArch's ELF linker where .got.plt entries are misaligned in static Position-Dependent Executables (PDE).
proposer
Xi Ruoyao <xry111@xry111.site>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Correcting miscalculation of .got.plt addresses ensures proper dynamic linking behavior.
  • • Refactoring code improves maintainability and reduces the risk of similar bugs.
  • • Ensuring static linking scenarios are handled correctly alongside dynamic ones.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • binutils
  • • loongarch
  • • elf
  • • linker
  • • gotplt
bugzilla_url
—
date
2026-08-02T00:00:00.000Z

[PATCH] LoongArch: fix .got.plt dislocation in static PDE

This patch addresses a bug in the LoongArch ELF linker where the calculation of .got.plt entry addresses was incorrect for static Position-Dependent Executables (PDE). The code incorrectly assumed the presence of two .got.plt entries reserved for ld.so, which do not exist in static PDE, leading to a two-slot dislocation of all .got.plt entries. This error, latent in earlier releases, became exploitable in 2.47.