Re: [PATCH] x86: Disallow ".long foo@PLT - .L4" for PLT32 relocation
Project / Subsystem
binutils / x86
Date
2026-08-04
Proposer
Jan Beulich <jbeulich@suse.com>
Source type
public_inbox
Consensus
Ready to Land
Sentiment
—/10
Technical tradeoffs
- • Disallowing the syntax outright, rather than issuing a warning, might break existing code that relies on this behavior, even if it's technically incorrect.
- • The decision to reject `.long` for PLT expressions implies that users must explicitly use the correct syntax, potentially increasing assembly code complexity.
All attributes
- project
- binutils
- subsystem
- x86
- patch_id
- —
- discussion_id
- 73f785be-5b1a-4c45-8b27-2611b242bd6d@suse.com
- source_type
- public_inbox
- title
- Re: [PATCH] x86: Disallow ".long foo@PLT - .L4" for PLT32 relocation
- headline
- x86: Disallow ".long foo@PLT - .L4" for PLT32 relocation
- tldr
- Binutils' x86 assembler now disallows `.long foo@PLT - .L4` to prevent incorrect PLT32 relocations.
- proposer
- Jan Beulich <jbeulich@suse.com>
- consensus
- Ready to Land
- outcome
- ready
- sentiment_score
- —
- technical_tradeoffs
-
- • Disallowing the syntax outright, rather than issuing a warning, might break existing code that relies on this behavior, even if it's technically incorrect.
- • The decision to reject `.long` for PLT expressions implies that users must explicitly use the correct syntax, potentially increasing assembly code complexity.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • x86
- • relocations
- • assembler
- • elf
- • plt
- bugzilla_url
- —
- date
- 2026-08-04T00:00:00.000Z
Re: [PATCH] x86: Disallow ".long foo@PLT - .L4" for PLT32 relocation
This change disallows the assembly syntax .long foo@PLT - .L4 for PLT32 relocations on x86. The discussion clarifies that the correct relocation type for PLT32 is R_X86_64_PLT32, which involves L + A - P. While .long can be used, it lacks a proper relocation type for PLT expressions, leading to potential issues. The decision is to reject this specific syntax to avoid ambiguity and ensure correct relocation handling, rather than issuing a warning, as it can originate from both hand-written and compiled code.