rl78: check relaxation delete range, propagate failures
Validate deletion range in elf32_rl78_relax_delete_bytes using
_bfd_elf_relax_delete_range_ok. Wrap SNIPNR and SNIP macros in
do-while(0) blocks. Propagate deletion return status in
rl78_elf_relax_section and branch to error_return on failure.
Add DejaGnu regression test ld-rl78/rl78-relax-underflow.exp.
Note that crafted inputs with out-of-range relocation offsets can
still fault during pre-deletion opcode rewriting in
rl78_elf_relax_section before the deletion helper is reached; those
pre-deletion bounds issues will be addressed separately.
Signed-off-by: Harshit Kumar <harshit7kr@gmail.com>
2 files changed