[PATCH 2/2] tests: aarch64: clean up BTI and GCS tests

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri Feb 6 12:50:33 GMT 2026



On 06/02/26 07:26, Yury Khrustalev wrote:
> No functional change, just cleaning up code, fixing style
> and correcting typos.


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c    | 6 ------
>  sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c    | 3 ---
>  sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c | 4 +---
>  sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c        | 8 +-------
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c  | 2 +-
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c          | 6 ++----
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h          | 3 ++-
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c        | 5 +----
>  .../unix/sysv/linux/aarch64/tst-gcs-preload-optional.c    | 2 +-
>  .../unix/sysv/linux/aarch64/tst-gcs-preload-override.c    | 2 +-
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c          | 5 +----
>  sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c        | 5 +----
>  12 files changed, 12 insertions(+), 39 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c b/sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c
> index 6385e41c65..f9f0b7b35c 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-bti-abort-static.c
> @@ -18,14 +18,8 @@
>     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
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c b/sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c
> index 99511e2775..21be05498a 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-bti-ld-debug-exe.c
> @@ -16,10 +16,7 @@
>     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>
>  
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c b/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c
> index 8f09a4fe04..c29e47a3b0 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton-dlopen.c
> @@ -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 ();
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c b/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c
> index bf0e62706f..87ce648f01 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-bti-skeleton.c
> @@ -17,10 +17,7 @@
>     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 ();
>  }
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c
> index b1e6423383..055ada9bd5 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-audit-override.c
> @@ -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"
>  
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c
> index f332116a21..06391e853c 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-dlopen.c
> @@ -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 ();
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h
> index 35ce0036ec..493f65b3cc 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h
> @@ -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 (
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c
> index fc173cefb3..2d4f20da87 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-noreturn.c
> @@ -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);
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-optional.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-optional.c
> index 9f6c1517c1..2e95717e91 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-optional.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-optional.c
> @@ -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"
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-override.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-override.c
> index 8ccb389d17..07b26895cd 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-override.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-preload-override.c
> @@ -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"
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c
> index a128a1912a..8a428fc734 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-shared.c
> @@ -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
> diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c
> index be39e99c24..2391267715 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-skeleton.c
> @@ -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");



More information about the Libc-alpha mailing list