This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] RISC-V: Eliminate spurious error w/ reloc truncated message
- From: Jim Wilson <jimw at sifive dot com>
- To: binutils at sourceware dot org
- Cc: Jim Wilson <jimw at sifive dot com>
- Date: Thu, 8 Feb 2018 13:19:05 -0800
- Subject: Re: [PATCH] RISC-V: Eliminate spurious error w/ reloc truncated message
- Authentication-results: sourceware.org; auth=none
- References: <84397e00-244e-aead-3512-4b682a37cb7c@redhat.com>
I don't see a similar comment in any other port, but it seems reasonable. Many
ports just return true unconditionally here. The riscv port has support to
return false if a malloc call fails. Otherwise, it should not return false
at present.
Committed.
Jim
bfd/
* elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
change.
---
bfd/elfnn-riscv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index a37f4aac76..dd9c300b5e 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -2253,6 +2253,8 @@ riscv_elf_relocate_section (bfd *output_bfd,
if (msg)
info->callbacks->warning
(info, msg, name, input_bfd, input_section, rel->r_offset);
+ /* We already reported the error via a callback, so don't try to report
+ it again by returning false. That leads to spurious errors. */
ret = TRUE;
goto out;
}
--
2.14.1