Skip to content

RISC-V: Fixed the overflow values for cv relocations

Created by: MaryBennett

Issue #73 (closed): https://github.com/openhwgroup/corev-binutils-gdb/issues/73

The issue describes a problem with the hardware loop relocations; they do not properly check for overflow. The function bfd_check_overflow in bfd/reloc.c was used to check for overflow but the incorrect addrsize was being passed in so the overflow was not being recognised.

The fix was to change addrsize to be the number of bytes operated on multiplied by 8 for each relocation.

Files Changed:

  • gas/config/tc-riscv.c(md_apply_fix): Changed the values of addrsize for BFD_RELOC_RISCV_CVPCREL_UI12 and BFD_RELOC_RISCV_CVPCREL_URS1. Also added in an overflow error message for each.

Merge request reports

Loading