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


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



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