[binutils-gdb] elf32-csky.c:3932:19: error: comparison is always false
Alan Modra
amodra@sourceware.org
Mon Dec 7 12:07:16 GMT 2020
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fde0214a915dc09743006022df2365f8e9ea3eed
commit fde0214a915dc09743006022df2365f8e9ea3eed
Author: Alan Modra <amodra@gmail.com>
Date: Mon Dec 7 14:03:47 2020 +1030
elf32-csky.c:3932:19: error: comparison is always false
It looks like csky missed out on an edit for 706704c8834. Not that it
matters very much. There doesn't appear to be any csky reloc howto
that sets the negate bit.
Similarly for ns32k and nds32.
* elf32-csky.c (csky_relocate_contents): Correct negate test.
* cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Likewise.
* elf32-nds32.c (nds32_relocate_contents): Likewise.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/cpu-ns32k.c | 4 +---
bfd/elf32-csky.c | 4 +---
bfd/elf32-nds32.c | 4 +---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1cf06249f3e..8a32d5c0102 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-07 Alan Modra <amodra@gmail.com>
+
+ * elf32-csky.c (csky_relocate_contents): Correct negate test.
+ * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Likewise.
+ * elf32-nds32.c (nds32_relocate_contents): Likewise.
+
2020-12-05 Maciej W. Rozycki <macro@linux-mips.org>
* elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32>: Use
diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c
index 789e56f4b5a..a7aa9f5df8a 100644
--- a/bfd/cpu-ns32k.c
+++ b/bfd/cpu-ns32k.c
@@ -574,9 +574,7 @@ _bfd_do_ns32k_reloc_contents (reloc_howto_type *howto,
bfd_vma x;
bfd_boolean overflow;
- /* If the size is negative, negate RELOCATION. This isn't very
- general. */
- if (howto->size < 0)
+ if (howto->negate)
relocation = -relocation;
/* Get the value we are going to relocate. */
diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
index 395e6ff67f9..8d48a03aadf 100644
--- a/bfd/elf32-csky.c
+++ b/bfd/elf32-csky.c
@@ -3927,9 +3927,7 @@ csky_relocate_contents (reloc_howto_type *howto,
unsigned int rightshift = howto->rightshift;
unsigned int bitpos = howto->bitpos;
- /* If the size is negative, negate RELOCATION. This isn't very
- general. */
- if (howto->size < 0)
+ if (howto->negate)
relocation = -relocation;
/* FIXME: these macros should be defined at file head or head file head. */
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 233af38c230..105d7f5d4ec 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -4492,9 +4492,7 @@ nds32_relocate_contents (reloc_howto_type *howto, bfd *input_bfd,
unsigned int rightshift = howto->rightshift;
unsigned int bitpos = howto->bitpos;
- /* If the size is negative, negate RELOCATION. This isn't very
- general. */
- if (howto->size < 0)
+ if (howto->negate)
relocation = -relocation;
/* Get the value we are going to relocate. */
More information about the Binutils-cvs
mailing list