diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-11-18 11:59:11 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-11-18 11:59:11 -0800 |
commit | a36a4fba58a3f04e9fa439c16e8d6e453ef6067d (patch) | |
tree | ac1d581261429b2991e06c62790dfe707f29be34 /binutils | |
parent | 48e795d4840529df2f3a0b8d1c44276ec43cc232 (diff) | |
download | riscv-gnu-toolchain-a36a4fba58a3f04e9fa439c16e8d6e453ef6067d.zip riscv-gnu-toolchain-a36a4fba58a3f04e9fa439c16e8d6e453ef6067d.tar.gz riscv-gnu-toolchain-a36a4fba58a3f04e9fa439c16e8d6e453ef6067d.tar.bz2 |
binutils: don't check AUIPC/LUI overflow for RV32
Any 32-bit address is in range of both instructions in RV32.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/bfd/elfnn-riscv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/binutils/bfd/elfnn-riscv.c b/binutils/bfd/elfnn-riscv.c index 9d5419d..06f1895 100644 --- a/binutils/bfd/elfnn-riscv.c +++ b/binutils/bfd/elfnn-riscv.c @@ -1482,7 +1482,7 @@ perform_relocation (const reloc_howto_type *howto, case R_RISCV_GOT_HI20: case R_RISCV_TLS_GOT_HI20: case R_RISCV_TLS_GD_HI20: - if (!VALID_UTYPE_IMM (RISCV_CONST_HIGH_PART (value))) + if (ARCH_SIZE > 32 && !VALID_UTYPE_IMM (RISCV_CONST_HIGH_PART (value))) return bfd_reloc_overflow; value = ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)); break; @@ -1503,7 +1503,7 @@ perform_relocation (const reloc_howto_type *howto, case R_RISCV_CALL: case R_RISCV_CALL_PLT: - if (!VALID_UTYPE_IMM (RISCV_CONST_HIGH_PART (value))) + if (ARCH_SIZE > 32 && !VALID_UTYPE_IMM (RISCV_CONST_HIGH_PART (value))) return bfd_reloc_overflow; value = ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)) | (ENCODE_ITYPE_IMM (value) << 32); |