[PATCH] riscv: add support for static PIE

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Jan 22 12:42:19 GMT 2024



On 22/01/24 09:28, Andreas Schwab wrote:
> 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?
> 

Alright, I will send it shortly.


More information about the Libc-alpha mailing list