]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tests: aarch64: clean up BTI and GCS tests
authorYury Khrustalev <yury.khrustalev@arm.com>
Thu, 5 Feb 2026 15:16:42 +0000 (15:16 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Fri, 6 Feb 2026 12:56:56 +0000 (12:56 +0000)
No functional change, just cleaning up code, fixing style
and correcting typos.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
12 files changed:
sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c
sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c
sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c
sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h
sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-optional.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-override.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c
sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c

index 6385e41c6559015c2546d74230b562b248d4efc3..f9f0b7b35c7562de7bc1b601d4a283770957c6ff 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdio.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
 #include <sys/auxv.h>
-
 #include <support/check.h>
-#include <support/support.h>
 #include <support/test-driver.h>
 
 static int
index 99511e27753ca1fb873d98f63f8717524d408635..21be05498a891eddb2ed32bd4f871746c47afcde 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdio.h>
 #include <sys/auxv.h>
-#include <sys/signal.h>
-
 #include <support/check.h>
 #include <support/test-driver.h>
 
index 8f09a4fe04003a40b2c4b11ae3f306c64977e660..c29e47a3b04fe8dbefe9598a6dc90fca93c3393c 100644 (file)
@@ -33,9 +33,7 @@ do_test (void)
 {
   unsigned long hwcap2 = getauxval (AT_HWCAP2);
   if ((hwcap2 & HWCAP2_BTI) == 0)
-    {
-      FAIL_UNSUPPORTED ("BTI is not supported by this system");
-    }
+    FAIL_UNSUPPORTED ("BTI is not supported by this system");
 
   void *h = dlopen (TEST_BTI_DLOPEN_MODULE, RTLD_NOW);
   const char *err = dlerror ();
index bf0e62706ff875937a7ebc85a27c0d357fbcd5b2..87ce648f01b9f1dc96e0d7749bbfbdb2abed15eb 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdio.h>
 #include <sys/auxv.h>
-#include <sys/signal.h>
-
 #include <support/check.h>
 #include <support/test-driver.h>
 
@@ -38,10 +35,7 @@ do_test (void)
 {
   unsigned long hwcap2 = getauxval (AT_HWCAP2);
   if ((hwcap2 & HWCAP2_BTI) == 0)
-    {
-      FAIL_UNSUPPORTED ("BTI is not supported by this system");
-    }
-
+    FAIL_UNSUPPORTED ("BTI is not supported by this system");
   fun_t fn = &fun;
   return fn ();
 }
index b1e6423383cd4d168bb4c9b9013472fd936bc211..055ada9bd5a661dae6759276e3b10f9f5d1c7efb 100644 (file)
@@ -1,5 +1,5 @@
 /* Check if the audit modules without GCS marking is loaded when GCS is
-   overrided.  */
+   overridden.  */
 
 #define AUDIT_MOD       "tst-gcs-audit1.so"
 
index f332116a21970f2b8627bd80f8d8ce34a4dd6fbd..06391e853cb3321d6f11c767af4595c7f192f422 100644 (file)
@@ -26,10 +26,8 @@ do_test (void)
 {
   /* Check if GCS could possible by enabled.  */
   if (!(getauxval (AT_HWCAP) & HWCAP_GCS))
-    {
-      puts ("kernel or CPU does not support GCS");
-      return EXIT_UNSUPPORTED;
-    }
+    FAIL_UNSUPPORTED ("kernel or CPU does not support GCS");
+
   /* The tst-gcs-mod2.so test library does not have GCS marking.  */
   void *h = dlopen ("tst-gcs-mod2.so", RTLD_NOW);
   const char *err = dlerror ();
index 35ce0036ec4230a8a3aab77600f650bcc381087c..493f65b3cc6bbb376fb83b051be9698c1061b6e1 100644 (file)
@@ -26,7 +26,8 @@
 #include <stdio.h>
 #include <sys/auxv.h>
 
-static bool __check_gcs_status (void)
+static bool
+__check_gcs_status (void)
 {
   register unsigned long x16 asm ("x16");
   asm volatile (
index fc173cefb3f9ffc8eac6aab9b16c2d637ee2209f..2d4f20da87b1b6fee7dd001b194c467c89adc751 100644 (file)
@@ -73,10 +73,7 @@ do_test (void)
 {
   /* Check if GCS could possible by enabled.  */
   if (!(getauxval (AT_HWCAP) & HWCAP_GCS))
-    {
-      puts ("kernel or CPU does not support GCS");
-      return EXIT_UNSUPPORTED;
-    }
+    FAIL_UNSUPPORTED ("kernel or CPU does not support GCS");
   bool gcs_enabled = __check_gcs_status ();
   /* This test should be rung with GCS initially disabled.  */
   TEST_VERIFY (!gcs_enabled);
index 9f6c1517c1dd6db454fcd838bdb91c4cb21b5b43..2e95717e916664218f15473f15b069644c8be460 100644 (file)
@@ -1,4 +1,4 @@
-/* Checks if GCS is disabled when a LD_PRELOADA is used without GCS marking
+/* Checks if GCS is disabled when a LD_PRELOAD is used without GCS marking
    and GCS is optional.  */
 #define TEST_GCS_EXPECT_ENABLED 0
 #include "tst-gcs-skeleton.c"
index 8ccb389d175c4366f5bb9c285bf8bb6782ccceb5..07b26895cd6746ae9b2b8aab1f19f4a412304eb9 100644 (file)
@@ -1,4 +1,4 @@
 /* Checks if GCS is enabled when a LD_PRELOAD is used without GCS marking and
-   GCS is overrided.  */
+   GCS is overridden.  */
 #define TEST_GCS_EXPECT_ENABLED 1
 #include "tst-gcs-skeleton.c"
index a128a1912a5eed6a439826e3e8a928ea3d969724..8a428fc734e11ec5f47077eb125b7d2069943236 100644 (file)
@@ -26,10 +26,7 @@ do_test (void)
 {
   /* Check if GCS could possible by enabled.  */
   if (!(getauxval (AT_HWCAP) & HWCAP_GCS))
-    {
-      puts ("kernel or CPU does not support GCS");
-      return EXIT_UNSUPPORTED;
-    }
+    FAIL_UNSUPPORTED ("kernel or CPU does not support GCS");
 #if TEST_GCS_EXPECT_ENABLED
   TEST_VERIFY (__check_gcs_status ());
 #else
index be39e99c24e45240175c9d01b9405b432f3e9c5c..2391267715cad7189390f84dbcb8ebbf5caf89b1 100644 (file)
@@ -23,10 +23,7 @@ do_test (void)
 {
   /* Check if GCS could possible by enabled.  */
   if (!(getauxval (AT_HWCAP) & HWCAP_GCS))
-    {
-      puts ("kernel or CPU does not support GCS");
-      return EXIT_UNSUPPORTED;
-    }
+    FAIL_UNSUPPORTED ("kernel or CPU does not support GCS");
   bool gcs_enabled = __check_gcs_status ();
   if (gcs_enabled)
     puts ("GCS enabled");