[PATCH] x86-64: Generate R_X86_64_PLT32 for ".long foo@PLT - .L4"
Project / Subsystem
binutils / x86-64
Date
2026-07-25
Proposer
"H.J. Lu" <hjl.tools@gmail.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • Introducing a new relocation type adds complexity to the binutils codebase but enables support for specific PIC optimizations.
- • Correctly handling PLT-relative relocations is essential for the performance and correctness of dynamically linked executables.
All attributes
- project
- binutils
- subsystem
- x86-64
- patch_id
- —
- discussion_id
- CAMe9rOpFTW9DN_0ZjSEaL6rN0QM+RsKg7PAmwrys1gRgEoLzpA@mail.gmail.com
- source_type
- public_inbox
- title
- [PATCH] x86-64: Generate R_X86_64_PLT32 for ".long foo@PLT - .L4"
- headline
- x86-64: Generate R_X86_64_PLT32 for ".long foo@PLT - .L4"
- tldr
- Adds a new relocation type R_X86_64_PLT32 to binutils for specific PIC scenarios involving PLT entries.
- proposer
- "H.J. Lu" <hjl.tools@gmail.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • Introducing a new relocation type adds complexity to the binutils codebase but enables support for specific PIC optimizations.
- • Correctly handling PLT-relative relocations is essential for the performance and correctness of dynamically linked executables.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • binutils
- • assembler
- • x86-64
- • relocation
- • PIC
- bugzilla_url
- —
- date
- 2026-07-25T00:00:00.000Z
[PATCH] x86-64: Generate R_X86_64_PLT32 for ".long foo@PLT - .L4"
This patch introduces the BFD_RELOC_X86_64_PLT32 relocation type and uses it in the gas assembler for x86-64 targets. This addresses PR gas/34423 by generating the R_X86_64_PLT32 relocation for directives like .long foo@PLT - .L4. The intention is to ensure that relocations against function symbols in such directives are correctly resolved using PLT entries, specifically for PC32 relative relocations.