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

Alistair Francis alistair23@gmail.com
Fri Jul 10 21:35:23 GMT 2020


On Tue, Jun 30, 2020 at 5:45 PM Maciej W. Rozycki via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Mon, 29 Jun 2020, Jim Wilson wrote:
>
> > Anyways, if you want to know where the PLT call is coming from, you
> > can't rely on the relocs.  R_RISCV_CALL_PLT is not necessarily a plt
> > call.
>
>  If a PLT entry has been created, then the linker must have considered the
> symbol referred preemptible, whether legitimately or not.
>
>  Rather than scratching one's head I would suggest running the relevant LD
> invocation under GDB to find out what really happens there, which may be
> as easy as setting a breakpoint on `riscv_elf_finish_dynamic_symbol' with
> the right condition on the hash entry so as to stop on `memset' only, and
> then working backwards with a watchpoint (on a host system that does not
> use ASLR) to find out what sets `h->plt.offset'.  There'll be the answer.

I tried to look into this but haven't made much progress here. If
anyone has more ideas they would be very welcome otherwise I'll keep
digging into this.

Alistair

>
>  HTH,
>
>   Maciej


More information about the Libc-alpha mailing list