[PATCH v2] x86: Generate PLT32 relocation for ".long foo@PLT - .L4"

Project / Subsystem

binutils / x86

Date

2026-07-27

Proposer

H.J. Lu <hjl.tools@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Aligns binutils behavior with LLVM, improving consistency across different toolchains.
  • Resolves a specific bug (PR gas/34423) related to how certain function calls are resolved.
  • Introduces new relocation types and handling logic into the assembler and linker.

All attributes

project
binutils
subsystem
x86
patch_id
discussion_id
CAMe9rOoQR-AGCqWqfL5vHw45bBVZ03MQhQygKf-AvULkZ2p65w@mail.gmail.com
source_type
public_inbox
title
[PATCH v2] x86: Generate PLT32 relocation for ".long foo@PLT - .L4"
headline
x86: Generate PLT32 relocation for .long foo@PLT - .L4
tldr
Adds support for generating PLT32 relocations for x86 and x86-64, mirroring LLVM assembler's behavior for directives like '.long foo@PLT - .L4'.
proposer
H.J. Lu <hjl.tools@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Aligns binutils behavior with LLVM, improving consistency across different toolchains.
  • Resolves a specific bug (PR gas/34423) related to how certain function calls are resolved.
  • Introduces new relocation types and handling logic into the assembler and linker.
series_id
series_role
standalone
series_parts
[]
tags
  • x86
  • relocation
  • assembler
  • linker
  • patch
bugzilla_url
date
2026-07-27T00:00:00.000Z

[PATCH v2] x86: Generate PLT32 relocation for ".long foo@PLT - .L4"

This patch introduces support for generating PLT32 relocations for x86 and x86-64 architectures, aligning with the functionality of the LLVM assembler. It enables the handling of directives such as “.long foo@PLT - .L4” by generating R_X86_64_PLT32 relocations, which utilize PLT entries to resolve PC32 relocations against function symbols. This addresses PR gas/34423 and includes updates to BFD, gas, and ld components, along with new test cases.