[PATCH v7 1/8] arm: Add the clone3 wrapper
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Aug 11 14:12:33 GMT 2023
On 11/08/23 07:17, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> + /* Do the syscall, the kernel expects:
>> + r7: system call number:
>> + r0: cl_args
>> + r1: size */
>> + push { r7 }
>> + cfi_adjust_cfa_offset (4)
>> + cfi_rel_offset (r7, 0)
>> + ldr r7, =SYS_ify(clone3)
>> + swi 0x0
>> + cfi_endproc
>> +
>> + cmp r0, #0
>> + beq 1f
>> + pop {r7}
>
>> +1:
>> + .fnstart
>> + .cantunwind
>> + mov r0, r3
>> + mov ip, r2
>> + BLX (ip)
>
> I think the stack is misaligned at the BNLX call because only one 4-byte
> register is pushed.
It should not matter because the stack is defined by the cl_args::stack
argument. We might add a alignment check on clone-internal.c, but I
think since it uses solely on internal usage, it should be required.
More information about the Libc-alpha
mailing list