]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: Add GCS support to vfork
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 27 Dec 2023 18:36:10 +0000 (18:36 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Mon, 20 Jan 2025 09:22:41 +0000 (09:22 +0000)
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/aarch64/vfork.S

index 27618567f10021658fd8d6d695bea741973363d7..d5943a74859fb55f7d1632dc0a84ee9bd11faf22 100644 (file)
@@ -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)