[PATCH] riscv: add support for static PIE

Andreas Schwab schwab@suse.de
Mon Jan 22 09:35:58 GMT 2024


On Jan 18 2024, Adhemerval Zanella Netto wrote:

> Otherwise the startup code will trigger an invalid memory access (since the
> stack protector is not yet initialized):
>
> $ gdb ./elf/ldconfig
> [...]
> (gdb) r
> [...]
> (gdb) disas
> Dump of assembler code for function memset:
>    0x00007ffff7f6e3ec <+0>:     addi    sp,sp,-32
>    0x00007ffff7f6e3ee <+2>:     auipc   a7,0x89
>    0x00007ffff7f6e3f2 <+6>:     ld      a7,2018(a7) # 0x7ffff7ff7bd0
> => 0x00007ffff7f6e3f6 <+10>:    ld      a5,0(a7)

I don't see that with -fstack-protector-strong.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list