This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] RISC-V: Force linker error exit after unresolvable reloc.
- From: Jim Wilson <jimw at sifive dot com>
- To: "Maciej W. Rozycki" <macro at wdc dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 30 Sep 2019 13:38:06 -0700
- Subject: Re: [PATCH] RISC-V: Force linker error exit after unresolvable reloc.
- References: <20190830221610.2559-1-jimw@sifive.com> <alpine.LFD.2.21.1909300507460.28360@redsun52.ssa.fujisawa.hgst.com>
On Mon, Sep 30, 2019 at 5:39 AM Maciej W. Rozycki <macro@wdc.com> wrote:
> FYI, it's better done with one the percent-codes to `_bfd_error_handler'
> rather than aborting the link right away, so that any further link errors
> are also reported and you don't have to shake them out one by one. I've
> done such an improvement for several error cases in the MIPS backend.
I was pressed for time. I found this by accident while working on a
bigger and more important problem. The right way to fix this is
presumably the same way I fixed the bfd_reloc_dangerous support later
in the same function.
I don't see the practical use for emitting more linker errors in this
case though. If you accidentally linked non-pic code into a shared
library, then you are just going to get a lot of copies of the exact
same error message. The fix is to recompile PIC. You don't need more
than one error message to figure this out.
> Since none was attached to this change of yours, is there a test case (as
> one obviously should) already present in the LD test suite that covers
> this error? If so, then I can start from there and provide you with a
> quick change to show you what I mean.
There is a testcase in the email. There isn't one in the ld testsuite
because I was pressed for time.
I don't see how this helps me. I already know how to fix it
correctly. I just don't have time to do that. I can put finishing
this on my to do list, but it may be a very long wait before I have
time to work on this again. Unless maybe I can get someone else
inside SiFive to work on this, we do have a new guy that is doing some
binutils work that might be able to help.
Jim