aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2023-12-27 18:36:10 +0000
committerYury Khrustalev <yury.khrustalev@arm.com>2025-01-20 09:22:41 +0000
commit1cf59c2603be88e3c97e68b1f219647f20310215 (patch)
treea0aae49f4af85f1c8ab6317ff4b40ad061ca67b6 /sysdeps
parent5ff5e7836e97a2d87778936b29c9607c120251be (diff)
downloadglibc-1cf59c2603be88e3c97e68b1f219647f20310215.zip
glibc-1cf59c2603be88e3c97e68b1f219647f20310215.tar.gz
glibc-1cf59c2603be88e3c97e68b1f219647f20310215.tar.bz2
aarch64: Add GCS support to vfork
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/vfork.S7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S
index 2761856..d5943a7 100644
--- a/sysdeps/unix/sysv/linux/aarch64/vfork.S
+++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S
@@ -33,8 +33,13 @@ ENTRY (__vfork)
cmn x0, #4095
b.cs .Lsyscall_error
+ cbz x0, L(child)
RET
-
+L(child):
+ /* Return with indirect branch in the child to support GCS.
+ Compilers insert BTI instruction after vfork() to make
+ sure return via BR works on systems with BTI. */
+ br x30
PSEUDO_END (__vfork)
libc_hidden_def (__vfork)