diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-03-20 04:13:18 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-03-21 12:44:40 -0700 |
commit | 4bb20a6244b7091a9a7a2ae35dfbd7e8db27550a (patch) | |
tree | b2f204a9ddd73225aa7216a94afd8ca504ba4606 /gdbserver | |
parent | 7e949f08700b077b78e955c653eb4e9455027101 (diff) | |
download | gdb-4bb20a6244b7091a9a7a2ae35dfbd7e8db27550a.zip gdb-4bb20a6244b7091a9a7a2ae35dfbd7e8db27550a.tar.gz gdb-4bb20a6244b7091a9a7a2ae35dfbd7e8db27550a.tar.bz2 |
gdbserver: Clear X86_XSTATE_MPX bits in xcr0 on x32
Since MPX isn't available for x32, we should clear X86_XSTATE_MPX bits
on x32.
PR server/31511
* linux-x86-low.cc (x86_linux_read_description): Clear
X86_XSTATE_MPX bits in xcr0 on x32.
Reviewed-by: Felix Willgerodt <felix.willgerodt@intel.com>
Diffstat (limited to 'gdbserver')
-rw-r--r-- | gdbserver/linux-x86-low.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 3af0a00..933d1fb 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -938,6 +938,10 @@ x86_linux_read_description (void) xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET / sizeof (uint64_t))]; + /* No MPX on x32. */ + if (machine == EM_X86_64 && !is_elf64) + xcr0 &= ~X86_XSTATE_MPX; + xsave_len = x86_xsave_length (); /* Use PTRACE_GETREGSET if it is available. */ |