]> git.feebdaed.xyz Git - 0xmirror/glibc.git/commit
x32: Implement prctl in assembly
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 7 Dec 2025 03:33:33 +0000 (11:33 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 8 Dec 2025 22:41:55 +0000 (06:41 +0800)
commit6afabde23ee0ad9d713fcebf9b1fd7c572a671af
tree6b52aac47c99ebf1432a7621536d223346809a39
parentf56a71097f39f2737e76b3807201a4028e06c611
x32: Implement prctl in assembly

Since the variadic prctl function takes at most 5 integer arguments which
are passed in the same integer registers on x32 as the function with 5
integer arguments, we can use assembly for prctl.  Since upper 32-bits in
the last 4 arguments of pcrtl must be cleared to match the x32 prctl
syscall interface where the last 4 arguments are unsigned 64 bit longs,
implement prctl in assembly to clear upper 32-bits in the last 4 arguments
and add a test to verify it.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/unix/sysv/linux/x86_64/x32/Makefile
sysdeps/unix/sysv/linux/x86_64/x32/prctl.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86_64/x32/prctl.c [deleted file]
sysdeps/unix/sysv/linux/x86_64/x32/tst-prctl-x32.c [new file with mode: 0644]