]> git.ipfire.org Git - thirdparty/glibc.git/commit
hppa: Fix strace detach-vfork test
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 19 Dec 2024 16:30:09 +0000 (11:30 -0500)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 19 Dec 2024 16:32:13 +0000 (11:32 -0500)
commit9fbfbd924f718663d5303858f34d1f857c375093
tree71a192b492adf8e5cbb5042c3b2e8037d6acc48d
parent94e4a8c7d68129075f1b494a0b26151a4f989b36
hppa: Fix strace detach-vfork test

This change implements vfork.S for direct support of the vfork
syscall.  clone.S is revised to correct child support for the
vfork case.

The main bug was creating a frame prior to the clone syscall.
This was done to allow the rp and r4 registers to be saved and
restored from the stack frame.  r4 was used to save and restore
the PIC register, r19, across the system call and the call to
set errno.  But in the vfork case, it is undefined behavior
for the child to return from the function in which vfork was
called.  It is surprising that this usually worked.

Syscalls on hppa save and restore rp and r19, so we don't need
to create a frame prior to the clone syscall.  We only need a
frame when __syscall_error is called.  We also don't need to
save and restore r19 around the call to $$dyncall as r19 is not
used in the code after $$dyncall.

This considerably simplifies clone.S.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
sysdeps/unix/sysv/linux/hppa/clone.S
sysdeps/unix/sysv/linux/hppa/vfork.S [new file with mode: 0644]