[PATCH] bfd/RISC-V: Repeat a single target relax pass instead of 3
Lewis Revill
lewis.revill@embecosm.com
Mon Oct 11 08:43:21 GMT 2021
On Fri, 8 Oct 2021 at 17:24, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> I haven't looked at the patch (and must have missed the earlier
> discussion), but the specific case that I was trying to solve with the
> R_RISCV_DELETE split was something like
>
>
> r0: auipc t0, symbol0
> r1: auipc t1, symbol1
> ld t0, symbol0, r0 # reloc points to r0
> ld t1, symbol1, r1 # reloc points to r1
>
> in this case, if the auipc at r0 gets deleted then we end up with an
> aliasing issue and need some way to disambiguate which of the two
> symbols we're targeting. I don't remember if we ever put a test case in
> there for this, but it did manifest in real code (IIRC it was a Linux
> build, but you need to twiddle all the compiler flags so it'll schedule
> the auipc-based pairs).
>
> The idea behing the extra pass here was to split this into two phases,
> so we could resolve the addresses before creating the ambiguities.
Thanks Palmer, I've checked the behaviour of my patch versus before my
patch and it appears the same. But just to be sure do you maybe have a
full testcase with more context, EG location of symbol0 and symbol1? I
will also have a look through and try to reason why my patch would still
be able to handle this.
More information about the Binutils
mailing list