rl78: return false from relax_section error path
Fix rl78 ELF relaxation to return false on error, preventing OOM/IO failures from succeeding silently.
This patch corrects an error path in the rl78 ELF relaxation function (rl78_elf_relax_section). Previously, it incorrectly returned true on out-of-memory or I/O failures. This change ensures it returns false, preventing the linker from proceeding with corrupted state after such errors.
- proposer
Corrects `rl78_elf_relax_section` to return false on error, preventing silent success of OOM/IO failures.
“In rl78_elf_relax_section, the error_return: block previously returned true, causing OOM and I/O failures during section reading to silently succeed and proceed with corrupt state. Correct error_return: to return false.”
In Details
This patch modifies the rl78_elf_relax_section function within bfd/elf32-rl78.c. The function handles linker relaxation for the RL78 architecture. The fix ensures that error conditions, such as memory allocation failures or I/O errors during section processing, correctly return a failure status (false) instead of a success status (true), thus preventing the linker from continuing with an invalid internal state.