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

Alistair Francis alistair23@gmail.com
Mon Jun 29 16:00:23 GMT 2020


On Mon, Jun 29, 2020 at 8:58 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> 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?
>
> I see this (which I'm guessing is the PLT call) in libc.a
>
> 00000012 <.LVL4>:
>     *ptr++ = 0ul;
>   12:   00000097                auipc   ra,0x0
>                         12: R_RISCV_CALL        memset
>                         12: R_RISCV_RELAX       *ABS*
>   16:   000080e7                jalr    ra # 12 <.LVL4>
>
> Which is called from the __sigblock() function.

Ah, I just checked libgcc, it has the memset PLT call:

0000020e <.L27>:
 20e:   0605                    addi    a2,a2,1
 210:   060a                    slli    a2,a2,0x2
 212:   4581                    li      a1,0
 214:   00000097                auipc   ra,0x0
                        214: R_RISCV_CALL_PLT   memset
                        214: R_RISCV_RELAX      *ABS*
 218:   000080e7                jalr    ra # 214 <.L27+0x6>

There are a few of them in libgcc.a as well.

Alistair

>
> Alistair
>
> >
> > Thanks,
> > Florian
> >


More information about the Libc-alpha mailing list