[PATCH v3] RISC-V: Fix IFUNC resolver cannot access gp pointer
Yangyu Chen
cyy@cyyself.name
Thu Jan 9 07:18:45 GMT 2025
On 1/8/25 15:24, Florian Weimer wrote:
> * Yangyu Chen:
>
>> Can we move the IFUNC invocation function to somewhere after the
>> relocation?
>
> IFUNC invocation is needed as part of relocation. It's possible to
> delay IFUNC and copy relocations and apply them in a final relocation
> pass, but I'm not sure if it's worth the complexity in the glibc dynamic
> linker.
>
> But the gp issue is different: In the original design, the gp pointer is
> initialized by application code, and that definitely runs after
> relocation. Hence the DT_RISCV_GP_VALUE idea.
>
But here I have a question: Why is looking up global_pointer in .dynsym,
which is literally a SHN_ABS typed value (but we should add l_addr to it
before use), not safe during relocation? IIRC, it does not require
dynamic symbol resolution. Am I missing something?
Thanks,
Yangyu Chen
> Thanks,
> Florian
More information about the Libc-alpha
mailing list