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: Nick Clifton <nickc at redhat dot com>
- To: Jim Wilson <jimw at sifive dot com>, binutils at sourceware dot org
- Date: Thu, 8 Feb 2018 11:27:39 +0000
- Subject: Re: [PATCH] RISC-V: Eliminate spurious error w/ reloc truncated message
- Authentication-results: sourceware.org; auth=none
- References: <20180207005514.27848-1-jimw@sifive.com>
Hi Jim,
> The problem is that the riscv relocate_section function is using callbacks to
> report an error, and then returning false, which confuses the linker into
> thinking that there was a second unreported error. The first error, relocation
> truncated, tried reading debug info to pretty print the error message, and
> along the way tried to read a separate debug info file which failed, setting
> bfd_error, which is where the second error message comes from. The solution
> is just that we should not return false after successfully reporting an error
> via callbacks.
> @@ -2253,6 +2253,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
> if (msg)
> info->callbacks->warning
> (info, msg, name, input_bfd, input_section, rel->r_offset);
> + ret = TRUE;
> goto out;
> }
Just a thought - it might be worth adding a comment here so that a reader of
the code can understand why a "success" result is being returned for an error.
Cheers
Nick