riscv: ifunc symbols don't link correctly in RTLD_NOW mode

Gilles Duboscq gilles.m.duboscq@gmail.com
Tue Dec 8 08:48:13 GMT 2020


Thanks for the pointer Jim!

So regarding the __riscv_flush_icache issue, I see that a more
targeted temporary fix would be to not use ifuncs for now.
A non-ifunc version already exists for the !SHARED case.
I'll use that locally while proper ifunc support lands. I've attached
a patch to my bug report.

 Gilles


 Gilles

On Mon, 7 Dec 2020 at 22:42, Jim Wilson <jimw@sifive.com> wrote:
>
> On Mon, Dec 7, 2020 at 12:51 AM Gilles Duboscq via Libc-alpha <libc-alpha@sourceware.org> wrote:
>>
>> While looking at some JIT compiler code on riscv, i noticed
>> __riscv_flush_icache doesn't always work.
>> It turns out that __riscv_flush_icache is an "ifunc" symbol and such
>> symbols don't link correctly when they are used from a library opened
>> with RTLD_NOW on riscv.
>
>
> Vincent Chen posted a patch last week to add RISC-V glibc ifunc support.  We just recently added ifunc support to GNU binutils and GCC.
>     https://sourceware.org/pipermail/libc-alpha/2020-December/120236.html
> This patch has review comments and needs to be updated.  I pointed him at your bug report earlier, and he has already confirmed that the patch fixes the bug you reported.
>
> Jim
>


More information about the Libc-alpha mailing list