* [PATCH] gdbserver: Clear X86_XSTATE_MPX bits in xcr0 on x32
@ 2024-03-19 15:25 H.J. Lu
0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2024-03-19 15:25 UTC (permalink / raw)
To: binutils; +Cc: felix.willgerodt, jhb
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.
---
gdbserver/linux-x86-low.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index 3af0a009052..28b5d523b8e 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 (!is_elf64)
+ xcr0 &= ~X86_XSTATE_MPX;
+
xsave_len = x86_xsave_length ();
/* Use PTRACE_GETREGSET if it is available. */
--
2.44.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-19 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 15:25 [PATCH] gdbserver: Clear X86_XSTATE_MPX bits in xcr0 on x32 H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).