]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 11 Sep 2025 01:46:07 +0000 (22:46 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Wed, 17 Sep 2025 19:40:58 +0000 (16:40 -0300)
Luis noticed that when adding the gcs and gcs_linux members to struct
aarch64_features in my Guarded Control Stack patch series, I neglected to
modify struct hash<aarch64_features>::operator() to take them into account
when computing its hash.

This can cause GDB to use the wrong aarch64_features object during a
debugging session.

Regression tested on aarch64-linux-gnu.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33440
Suggested-by: Luis Machado <luis.machado.foss@gmail.com>
Approved-By: Luis Machado <luis.machado.foss@gmail.com>
gdb/arch/aarch64.h

index 679d845df74ee5a9f8256b58508e306cea036f91..0fcdba7fb7d6bb8a3f2084d46e53cbc6133e7429 100644 (file)
@@ -94,6 +94,10 @@ namespace std
 
       /* SME2 feature.  */
       h = h << 1 | features.sme2;
+
+      h = h << 1 | features.gcs;
+      h = h << 1 | features.gcs_linux;
+
       return h;
     }
   };