aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-11-26 14:06:12 +0000
committerNick Clifton <nickc@redhat.com>2019-11-26 14:06:12 +0000
commit239b426b11425c4bd6b36aa7fd92a01e74fd42cb (patch)
tree0e23807053464a5a1c19321a6bd37d18fe50b41b /bfd/elf32-sh.c
parent42971193643cb2ec655a2b11315d425e290fe50e (diff)
downloadgdb-239b426b11425c4bd6b36aa7fd92a01e74fd42cb.zip
gdb-239b426b11425c4bd6b36aa7fd92a01e74fd42cb.tar.gz
gdb-239b426b11425c4bd6b36aa7fd92a01e74fd42cb.tar.bz2
Fix comparison operations in SH code that trigger warning in clang.
* elf32-sh.c (sh_elf_reloc): Use a signed_vma when checking for a negative relocated value. * coff-sh.c (sh_reloc): Likewise.
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 8aa49b0..863e2e1 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -288,7 +288,7 @@ sh_elf_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol_in,
sym_value -= 0x1000;
insn = (insn & 0xf000) | (sym_value & 0xfff);
bfd_put_16 (abfd, (bfd_vma) insn, hit_data);
- if (sym_value < (bfd_vma) -0x1000 || sym_value >= 0x1000)
+ if ((bfd_signed_vma) sym_value < -0x1000 || sym_value >= 0x1000)
return bfd_reloc_overflow;
break;
default: