gdb: x86: fix x32 builds with inline asm
authorMike Frysinger <vapier@gentoo.org>
Tue, 8 Jan 2013 19:38:51 +0000 (19:38 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 8 Jan 2013 19:38:51 +0000 (19:38 +0000)
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>
gdb/ChangeLog
gdb/common/linux-ptrace.c

index 8ba8772c244998a9063f99380bcb1bc0b543328e..3928ac63f882dd985b2f2874e6652c330fcc2831 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2013-01-08  Hui Zhu  <hui_zhu@mentor.com>
 
        * printcmd.c: Remove define of function output_command.
index 761ef597bfe8cd4b71ba542fe605c83ba9e681ee..886be809d1d1aa46aa7ddf17bc2cac120051874c 100644 (file)
@@ -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