WEDNESDAY, AUGUST 5, 2026
binutils/ld
Improve relocation error reporting for x86
Linker now provides more specific error messages for out-of-range relocations on x86.
The GNU linker has been updated to provide more detailed error messages when a relocation is out of the section’s range on x86 architectures. Previously, these errors were generic. This change introduces a new function to report the specific relocation type and target, making it easier to diagnose issues, as demonstrated in PR ld/34448.
In Details
This commit refactors relocation error handling in the x86 ELF backend. It introduces _bfd_x86_elf_link_report_relocation_error to provide more context for bfd_reloc_outofrange errors, moving away from a generic BFD error. This improves diagnostics for developers debugging linking issues on x86 targets.
For Context
- relocation
- A placeholder in compiled code that the linker resolves to a final memory address. Relocations tell the linker which parts of the code need to be patched up.
- x86
- A family of instruction set architectures (ISAs) for microprocessors, commonly used in personal computers and servers.
- ELF
- Executable and Linkable Format, a common standard file format for object files, executables, and shared libraries on Unix-like systems.
- linker
- A program that combines various pieces of code and data into a single executable program. It resolves symbol references between files and assigns final addresses.
- section
- A segment of an object file or executable that contains related data, such as code (.text), initialized data (.data), or uninitialized data (.bss).