[PATCH] riscv: add support for static PIE
Andreas Schwab
schwab@suse.de
Mon Jan 22 12:28:14 GMT 2024
On Jan 22 2024, Adhemerval Zanella Netto wrote:
> On 22/01/24 06:35, Andreas Schwab wrote:
>> 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.
>>
>
> It happens with -fstack-protector-all, which although it does not make much
> sense to be used it is still supported.
I think it can be part of a separate commit. Care to provide one?
--
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