This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RISC-V: Eliminate spurious error w/ reloc truncated message


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]