Landing: a692a633d407
Project / Subsystem
binutils / ld
Date
2026-08-06
Author
H.J. Lu
Commit
a692a633d407995a5ce87e84a0b1032e9ac51360
Source
public_inbox
Perf win
No
Breaking
No
All attributes
- project
- binutils
- subsystem
- ld
- patch_id
- —
- commit_hash
- a692a633d407995a5ce87e84a0b1032e9ac51360
- source_type
- public_inbox
- headline
- Improve error checking for garbage collection in ELF backend
- tldr
- ld now properly reports errors during ELF garbage collection when input sections have invalid data.
- author
- H.J. Lu
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • ld
- • linker
- • elf
- • garbage collection
- • error handling
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-06T00:00:00.000Z
The linker’s ELF backend now correctly handles errors during garbage collection of input sections. Previously, the bfd_gc_sections function could return false on invalid input without the linker reporting a fatal error. This change ensures that if gc_mark_extra_sections returns an error, bfd_gc_sections also returns false, and lang_gc_sections checks this return value to report a fatal error, preventing incorrect linking.