rl78: return false from relax_section error path
Fixes RL78 ELF relaxation to correctly report errors instead of silently succeeding.
The RL78 ELF relaxation function rl78_elf_relax_section incorrectly returned true in its error path for out-of-memory or I/O failures. This allowed the linker to proceed with corrupted state, potentially leading to further issues. This commit corrects the error path to return false, ensuring that such failures are properly reported and handled.
In Details
In bfd/elf32-rl78.c, the rl78_elf_relax_section function's error_return: label previously returned true. This masked critical failures like OOM or I/O errors during section processing. By changing this to return false;, the function now correctly signals an error, preventing the linker from continuing with potentially corrupt data.
- RL78
- A family of microcontrollers from Renesas Electronics.
- ELF
- Executable and Linkable Format, a standard file format for object files, executables, and libraries on Unix-like systems.
- Relaxation
- A linker optimization process where code or data addresses are adjusted to accommodate variable-length instructions or to optimize space, often occurring after initial assembly.
- bfd
- Binary File Descriptor library, a layer of abstraction in GNU Binutils for handling various object file formats.