older ld converts push with GOTPCRELX into call - is a local guard ok?
Project / Subsystem
binutils / binutils
Date
2026-07-09
Proposer
Dora, Sunil Kumar <SunilKumar.Dora@windriver.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
8/10
Technical tradeoffs
- • Addresses a critical bug affecting compatibility with newer assembler outputs.
- • Provides a workaround for older `ld` versions, allowing continued use on systems with distro-provided binutils.
- • Introduces a small code change to `bfd/elf64-x86-64.c`.
All attributes
- project
- binutils
- subsystem
- binutils
- patch_id
- —
- discussion_id
- DS0PR11MB7901CA36A47DC4A955D04F6BE0FE2@DS0PR11MB7901.namprd11.prod.outlook.com
- source_type
- public_inbox
- title
- older ld converts push with GOTPCRELX into call - is a local guard ok?
- headline
- ld converts push with GOTPCRELX into call - is a local guard okay?
- tldr
- Identifies a bug in older ld versions where GOTPCRELX on 'push' is incorrectly converted to 'call', causing crashes, and proposes a workaround.
- proposer
- Dora, Sunil Kumar <SunilKumar.Dora@windriver.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- 8
- technical_tradeoffs
-
- • Addresses a critical bug affecting compatibility with newer assembler outputs.
- • Provides a workaround for older `ld` versions, allowing continued use on systems with distro-provided binutils.
- • Introduces a small code change to `bfd/elf64-x86-64.c`.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • linker
- • x86-64
- • relocation
- • rustc
- • bugfix
- bugzilla_url
- —
- date
- 2026-07-09T00:00:00.000Z
older ld converts push with GOTPCRELX into call - is a local guard ok?
A bug in older versions of the ld linker (prior to binutils 2.45) causes a crash in Rust programs by misinterpreting the R_X86_64_GOTPCRELX relocation for push instructions. Instead of performing a push operation using the Global Offset Table (GOT), ld incorrectly converts it into an addr32 call to a read-only .rodata section. This patch proposes a local workaround to prevent ld from converting non-call/jmp relocations, which mimics the behavior of newer ld versions and resolves the issue for affected build hosts.