ft32: Correct relax_section error path to return false
Fixes the FT32 ELF relaxation function to correctly return false on error, preventing corrupted state from being treated as success.
This change corrects an error in the ft32_elf_relax_section function for the FT32 ELF target. Previously, the function’s error handling path incorrectly returned true, masking failures in reading section contents, symbols, or relocations, and errors from the elf32_ft32_relax_delete_bytes helper. This led to relaxation continuing with a corrupted state. The fix ensures that errors are properly reported by returning false.
In Details
In ft32_elf_relax_section, the error_return: label was incorrectly returning true. This meant that failures during section content reading, symbol/relocation fetching, or the elf32_ft32_relax_delete_bytes operation would not be propagated as errors. This commit changes the return value at error_return: to false, ensuring that relaxation failures are correctly signaled and do not lead to a corrupted intermediate state being used in subsequent operations.
- FT32
- A specific target architecture or ABI for which binutils has support, likely related to a 32-bit architecture.
- ELF
- Executable and Linkable Format, a standard file format for executables, object code, shared libraries, and core dumps on many Unix-like systems.
- Relaxation
- A linking process where the linker adjusts certain instructions or data after initial assembly. This is often done to accommodate relative addressing or to optimize code layout.