Landing: 5b57b7393a1e
Project / Subsystem
binutils / ld
Date
2026-09-10
Author
Alan Modra <amodra@sourceware.org>
Commit
5b57b7393a1e84aa6017e9e419b47e5f4f5ce4aa
Source
public_inbox
Perf win
No
Breaking
No
All attributes
- project
- binutils
- subsystem
- ld
- patch_id
- —
- commit_hash
- 5b57b7393a1e84aa6017e9e419b47e5f4f5ce4aa
- source_type
- public_inbox
- headline
- Make -u symbols load --as-needed shared libraries
- tldr
- The linker now correctly treats command-line -u symbols as references to load --as-needed shared libraries.
- author
- Alan Modra <amodra@sourceware.org>
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • linker
- • elf
- • shared libraries
- • optimization
- • testing
- discussion_id_link
- public_inbox:binutils#32816
- bugzilla_pr
- —
- date
- 2026-09-10T00:00:00.000Z
This change enhances the linker’s handling of the --as-needed option for shared libraries. Previously, an explicit symbol reference (-u symbol) on the command line would not cause an --as-needed shared library to be loaded if it wasn’t otherwise required. This commit modifies the linker to treat such symbols as a need, ensuring that --as-needed libraries are loaded when explicitly referenced, similar to how archives behave.