diff options
author | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 10:00:28 +0000 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 10:10:22 +0000 |
commit | ee4fbcfa26eb4a2a3666f7c1cc31447c3cffa023 (patch) | |
tree | 16ce0420d78dc816de2e8c1017a6b16efa229846 /gdb/aarch64-linux-tdep.c | |
parent | 6dc0ebde59dfb73eae507ced718bafa54023bf33 (diff) | |
download | gdb-ee4fbcfa26eb4a2a3666f7c1cc31447c3cffa023.zip gdb-ee4fbcfa26eb4a2a3666f7c1cc31447c3cffa023.tar.gz gdb-ee4fbcfa26eb4a2a3666f7c1cc31447c3cffa023.tar.bz2 |
AArch64: Use HWCAP to detect pauth feature
Add aarch64_get_hwcap functions for reading the HWCAP.
From this extract the PACA value and use this to enable pauth.
gdb/ChangeLog:
* aarch64-linux-nat.c
(aarch64_linux_nat_target::read_description): Read PACA hwcap.
* aarch64-linux-tdep.c
(aarch64_linux_core_read_description): Likewise.
(aarch64_linux_get_hwcap): New function.
* aarch64-linux-tdep.h (AARCH64_HWCAP_PACA): New define.
(aarch64_linux_get_hwcap): New declaration.
gdb/gdbserver/ChangeLog:
* linux-aarch64-low.c (AARCH64_HWCAP_PACA): New define.
(aarch64_get_hwcap): New function.
(aarch64_arch_setup): Read APIA hwcap.
Diffstat (limited to 'gdb/aarch64-linux-tdep.c')
-rw-r--r-- | gdb/aarch64-linux-tdep.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 445019a..d7db23e 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -637,12 +637,11 @@ aarch64_linux_core_read_description (struct gdbarch *gdbarch, { CORE_ADDR aarch64_hwcap = 0; - if (target_auxv_search (target, AT_HWCAP, &aarch64_hwcap) != 1) - return NULL; + if (!aarch64_linux_get_hwcap (target, &aarch64_hwcap)) + return nullptr; - /* pauth not yet supported. */ return aarch64_read_description (aarch64_linux_core_read_vq (gdbarch, abfd), - false); + aarch64_hwcap & AARCH64_HWCAP_PACA); } /* Implementation of `gdbarch_stap_is_single_operand', as defined in @@ -1420,6 +1419,15 @@ aarch64_linux_gcc_target_options (struct gdbarch *gdbarch) return NULL; } +/* See aarch64-linux-tdep.h. */ + +bool +aarch64_linux_get_hwcap (struct target_ops *target, CORE_ADDR *hwcap) +{ + *hwcap = 0; + return target_auxv_search (target, AT_HWCAP, hwcap) == 1; +} + static void aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { |