[PATCH] Allow memset local PLT reference for RISC-V.

Alistair Francis alistair23@gmail.com
Mon Jun 29 16:15:48 GMT 2020


On Mon, Jun 29, 2020 at 9:12 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Alistair Francis:
>
> > On Mon, Jun 29, 2020 at 2:11 AM Florian Weimer <fweimer@redhat.com> wrote:
> >>
> >> * Alistair Francis via Libc-alpha:
> >>
> >> > On Tue, Jun 23, 2020 at 12:19 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
> >> >>
> >> >> On Jun 22 2020, Alistair Francis via Libc-alpha wrote:
> >> >>
> >> >> > This is similar to commit a26e2e9feab87d4f745c31411458b048742ac733
> >> >> > "Allow memset local PLT reference for powerpc soft-float.".
> >> >> >
> >> >> > GCC 10.1 results in the localplt test failing for RISC-V.
> >> >>
> >> >> Why doesn't the redirect in sysdeps/generic/symbol-hacks.h work?
> >> >
> >> > I'm not sure.
> >> >
> >> > I  suspect it's the same reason it didn't work in the commit this is
> >> > based off: a26e2e9feab87d4f745c31411458b048742ac733
> >> > "Allow memset local PLT reference for powerpc soft-float.".
> >> >
> >> > The error is part of glibc's check scripts. I'm assuming memset is in
> >> > the binary which produces a check failure as we don't expect it to be.
> >> > I'm not sure where sysdeps/generic/symbol-hacks.h is involved in this
> >> > process though.
> >>
> >> Please post disassembly showing the location of the PLT calls.  Which
> >> functions have them?
> >
> > Sorry, I was waiting on my build to finish (I forgot to keep the
> > artifacts the first time).
> >
> > I'm assuming you wanted the objdump of libc.a?
>
> libc_pic.a.  libc.a is built for static linking and does not use the
> symbol hacks.
>
> If the PLT reference comes from libgcc.a, it won't show up in
> libc_pic.a, though.  It will only be present in libc.so.

Ah ok.

There is also a PLT memset in libc_pic.a

 1bc:   009aa023                sw      s1,0(s5)
          memset (result->__data, '\0',
 1c0:   865e                    mv      a2,s7
 1c2:   4581                    li      a1,0
 1c4:   008a8513                addi    a0,s5,8
 1c8:   00000097                auipc   ra,0x0
                        1c8: R_RISCV_CALL_PLT   __GI_memset
                        1c8: R_RISCV_RELAX      *ABS*
 1cc:   000080e7                jalr    ra # 1c8 <.LVL39+0x14>

Alistair

>
> Thanks,
> Florian
>


More information about the Libc-alpha mailing list