rtld: Clear x29 and lr for thread_start to conform Aarch64 ABI pcs

Strictly speaking, SYS V Aarch64 ABI does not states that lr should be
cleared, however gdb relies on lr and tryes to unwind stack further.

Reviewed by:
Differential Revision:	https://reviews.freebsd.org/D40841
This commit is contained in:
Dmitry Chagin 2023-07-07 19:55:43 +03:00
parent ac7759f545
commit 1a2aa2ffb5

View file

@ -223,6 +223,8 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size);
tf->tf_elr = (register_t)entry;
tf->tf_x[0] = (register_t)arg;
tf->tf_x[29] = 0;
tf->tf_lr = 0;
}
int