[PATCH 2/3] PE-COFF: Prefer weak external with defined fallback over null fallback
Project / Subsystem
binutils / pe-coff
Date
2026-05-30
Proposer
Peter Damianov <peter0x44@disroot.org>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • More complex symbol resolution logic vs. preventing crashes due to null fallbacks.
- • Potential for unexpected behavior if a null fallback is intentionally desired.
All attributes
- project
- binutils
- subsystem
- pe-coff
- patch_id
- —
- discussion_id
- 20260530191522.57144-3-peter0x44@disroot.org
- source_type
- public_inbox
- title
- [PATCH 2/3] PE-COFF: Prefer weak external with defined fallback over null fallback
- headline
- PE-COFF: Prefer weak external with defined fallback over null fallback
- tldr
- The linker now prefers weak external symbols with defined fallbacks over those with null fallbacks to avoid runtime crashes.
- proposer
- Peter Damianov <peter0x44@disroot.org>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • More complex symbol resolution logic vs. preventing crashes due to null fallbacks.
- • Potential for unexpected behavior if a null fallback is intentionally desired.
- series_id
- binutils:pe-coff: prefer weak external with defined fallback over null fallback
- series_role
- reply
- series_parts
- []
- tags
-
- • PE-COFF
- • linker
- • weak symbols
- • fallback
- • bfd
- bugzilla_url
- —
- date
- 2026-05-30T00:00:00.000Z
[PATCH 2/3] PE-COFF: Prefer weak external with defined fallback over null fallback
When linking PE COFF objects, the linker can encounter multiple weak external symbols for the same name. This patch modifies the linker to prefer a weak external with a non-null fallback (i.e., a function body) over one with a null fallback. This prevents runtime crashes that occur when the symbol resolves to address 0.