This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2] gdb: x86: fix x32 builds with inline asm
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Cc: hjl dot tools at gmail dot com, jan dot kratochvil at redhat dot com
- Date: Tue, 8 Jan 2013 13:44:59 -0500
- Subject: [PATCH v2] gdb: x86: fix x32 builds with inline asm
- References: <1357657280-24150-1-git-send-email-vapier@gentoo.org>
We need to cast the pointer up to 64bits so that the push works on x32
targets. For 64bit targets, this makes no difference.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-08 Mike Frysinger <vapier@gentoo.org>
* common/linux-ptrace.c (linux_ptrace_test_ret_to_nx) [__x86_64__]:
Cast return_address to 64bits.
---
v2
- just cast the value in the x86_64 path to fix x32 builds
gdb/common/linux-ptrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/common/linux-ptrace.c b/gdb/common/linux-ptrace.c
index 761ef59..886be80 100644
--- a/gdb/common/linux-ptrace.c
+++ b/gdb/common/linux-ptrace.c
@@ -114,7 +114,8 @@ linux_ptrace_test_ret_to_nx (void)
".globl linux_ptrace_test_ret_to_nx_instr;"
"linux_ptrace_test_ret_to_nx_instr:"
"ret"
- : : "r" (return_address) : "%rsp", "memory");
+ : : "r" ((uint64_t) (uintptr_t) return_address)
+ : "%rsp", "memory");
#else
# error "!__i386__ && !__x86_64__"
#endif
--
1.8.0.2