[RFC v3] RISC-V: Fix SIGSEGV of --static-pie binaries on riscv64 [BZ #33911]
H.J. Lu
hjl.tools@gmail.com
Sun Mar 8 15:48:48 GMT 2026
On Sat, Mar 7, 2026 at 10:22 PM daichengrong <daichengrong@iscas.ac.cn> wrote:
>
> This patch fixes a SIGSEGV observed in --static-pie binaries on riscv64,
> as reported in BZ #33911.
>
> The first issue occurs when compiler optimizations are enabled: memory
> initialization via `memset` may generate early libcalls before static PIE
> relocation, leading to incorrect symbol resolution.
>
> The second issue occurs when compiler optimizations are not enabled:
> `memcpy` may be emitted as a direct libc call instead of an inlined
> instruction sequence, which can also trigger relocation problems.
>
> This patch addresses both issues by providing safe early implementations
> that avoid generating libcalls before static PIE relocation, ensuring
> memory operations are performed correctly.
Can you update
riscv/multiarch/dl-symbol-redir-ifunc.h
instead?
--
H.J.
More information about the Libc-alpha
mailing list