aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-07-29 08:00:06 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-22 14:24:26 +0000
commitc505926c319b9ab6e849664968cb722c35acaf88 (patch)
tree193560328595d2d3f0dc53506d42935f3895e34b /sysdeps/unix
parentb8020168b5de9b2d2917ed6e1f5d152d51865769 (diff)
downloadglibc-c505926c319b9ab6e849664968cb722c35acaf88.zip
glibc-c505926c319b9ab6e849664968cb722c35acaf88.tar.gz
glibc-c505926c319b9ab6e849664968cb722c35acaf88.tar.bz2
aarch64: Fix the extension header write in getcontext and swapcontext
The extension header is two 32bit words and in the last header both should be 0. There is plenty space in the __reserved area, but it's better not to write more than we mean to.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/getcontext.S4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/swapcontext.S4
2 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/sysdeps/unix/sysv/linux/aarch64/getcontext.S
index 15fbd2d..3109cbd 100644
--- a/sysdeps/unix/sysv/linux/aarch64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/aarch64/getcontext.S
@@ -86,8 +86,8 @@ ENTRY(__getcontext)
/* Write the termination context extension header. */
add x2, x2, #FPSIMD_CONTEXT_SIZE
- str xzr, [x2, #oHEAD + oMAGIC]
- str xzr, [x2, #oHEAD + oSIZE]
+ str wzr, [x2, #oHEAD + oMAGIC]
+ str wzr, [x2, #oHEAD + oSIZE]
/* Grab the signal mask */
/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
index 1ee2e40..e3ec9da 100644
--- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
@@ -75,8 +75,8 @@ ENTRY(__swapcontext)
/* Write the termination context extension header. */
add x2, x2, #FPSIMD_CONTEXT_SIZE
- str xzr, [x2, #oHEAD + oMAGIC]
- str xzr, [x2, #oHEAD + oSIZE]
+ str wzr, [x2, #oHEAD + oMAGIC]
+ str wzr, [x2, #oHEAD + oSIZE]
/* Preserve ucp. */
mov x21, x1