]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: aarch64-linux: Define HWCAP_GCS as unsigned long long value
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 4 Sep 2025 16:50:44 +0000 (13:50 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 4 Sep 2025 22:54:31 +0000 (19:54 -0300)
On platforms where long is 32 bits, this change fixes a build failure:

/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c: In function ‘const target_desc* aarch64_linux_core_read_description(gdbarch*, target_ops*, bfd*)’:
/home/linux/arm/gdb/src/gdb/arch/aarch64-gcs-linux.h:27:24: error: left shift count >= width of type [-Werror=shift-count-overflow]
   27 | #define HWCAP_GCS (1UL << 32)
      |                    ~~~~^~~~~
/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c:1714:47: note: in expansion of macro ‘HWCAP_GCS’
 1714 |   features.gcs = features.gcs_linux = hwcap & HWCAP_GCS;
      |                                               ^~~~~~~~~

Suggested-by: Tom de Vries <tdevries@suse.de>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33372

gdb/arch/aarch64-gcs-linux.h
gdb/testsuite/gdb.arch/aarch64-gcs-core.c
gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.c
gdb/testsuite/gdb.arch/aarch64-gcs-return.c
gdb/testsuite/gdb.arch/aarch64-gcs.c
gdb/testsuite/lib/gdb.exp

index 922c779d139f63906632fbbfac8998f717a95974..018ca37a522825e9555a7f4a44cea61c80be2d72 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Feature check for Guarded Control Stack.  */
 #ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
 #endif
 
 /* Make sure we only define these if the kernel header doesn't.  */
index 77672047556f7a7ebfab5e0e0a7aff06f9d211bb..f3362cb1eb4ddb73014c36a17074701005622728 100644 (file)
@@ -23,7 +23,7 @@
 
 /* Feature check for Guarded Control Stack.  */
 #ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
 #endif
 
 #ifndef PR_GET_SHADOW_STACK_STATUS
index 3d895350ae422115d2499124919994af7cc56c9c..754fda1edba5816d8ff0eacbd2b851b395d27513 100644 (file)
@@ -23,7 +23,7 @@
 
 /* Feature check for Guarded Control Stack.  */
 #ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
 #endif
 
 #ifndef PR_GET_SHADOW_STACK_STATUS
index 95518b68bd7cd79f065a6121729a07dafb33b7c9..c062feaba7a033110c21169576dfe1b0e7ed4408 100644 (file)
@@ -23,7 +23,7 @@
 
 /* Feature check for Guarded Control Stack.  */
 #ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
 #endif
 
 #ifndef PR_GET_SHADOW_STACK_STATUS
index 39519e46705e322aeb6b47ea68a6d8c595db7410..9eb2e9eaa96b1f53675a67898717fd06db167b8f 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Feature check for Guarded Control Stack.  */
 #ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
 #endif
 
 #ifndef PR_GET_SHADOW_STACK_STATUS
index 5ba1c9059d03e8a3ae5cd7d9127faadd95e9b17b..fe4178ebba79fb2ff6b6c9730c2641e1ea347aa4 100644 (file)
@@ -5351,7 +5351,7 @@ gdb_caching_proc allow_aarch64_gcs_tests {} {
 
        /* Feature check for Guarded Control Stack.  */
        #ifndef HWCAP_GCS
-       #define HWCAP_GCS (1UL << 32)
+       #define HWCAP_GCS (1ULL << 32)
        #endif
 
        int main (void) {