diff --git a/arch/aarch64/defs.h b/arch/aarch64/defs.h index 469e69a..8c28be1 100644 --- a/arch/aarch64/defs.h +++ b/arch/aarch64/defs.h @@ -19,7 +19,7 @@ #endif #define FETCH_LINKPTR(dest) \ - asm("mov x0, %0" : "=rm" ((dest))) + asm("mov x0, %0" : "=r" ((dest))) #include "common-defs.h" diff --git a/arch/arm/defs.h b/arch/arm/defs.h index 0834d9e..7dd03b3 100644 --- a/arch/arm/defs.h +++ b/arch/arm/defs.h @@ -6,7 +6,7 @@ #define TYPE(__proc) #define FETCH_LINKPTR(dest) \ - asm("movs r0, %0" : "=rm" ((dest))) + asm("movs r0, %0" : "=r" ((dest))) #include "common-defs.h" diff --git a/arch/common/common-trampoline.c b/arch/common/common-trampoline.c index f182f99..dc5f2d3 100644 --- a/arch/common/common-trampoline.c +++ b/arch/common/common-trampoline.c @@ -19,6 +19,7 @@ libucontext_trampoline(void) { libucontext_ucontext_t *uc_link; + // FIXME: there's no guarantee that input is not clobbered! FETCH_LINKPTR(uc_link); if (uc_link == NULL) diff --git a/arch/m68k/defs.h b/arch/m68k/defs.h index 6a00651..fc19252 100644 --- a/arch/m68k/defs.h +++ b/arch/m68k/defs.h @@ -27,7 +27,7 @@ #define PC_OFFSET REG_OFFSET(REG_PC) #define FETCH_LINKPTR(dest) \ - asm("mov.l (%%sp, %%d7.l * 4), %0" : "=rm" ((dest))) + asm("mov.l (%%sp, %%d7.l * 4), %0" :: "r" ((dest))) #include "common-defs.h" diff --git a/arch/riscv64/defs.h b/arch/riscv64/defs.h index 191e8c2..d9b7647 100644 --- a/arch/riscv64/defs.h +++ b/arch/riscv64/defs.h @@ -48,7 +48,7 @@ #define PC_OFFSET REG_OFFSET(REG_PC) #define FETCH_LINKPTR(dest) \ - asm("mv %0, s1" : "=rm" ((dest))) + asm("mv %0, s1" : "=r" ((dest))) #include "common-defs.h" diff --git a/arch/sh/defs.h b/arch/sh/defs.h index dd13d47..7cddaef 100644 --- a/arch/sh/defs.h +++ b/arch/sh/defs.h @@ -13,7 +13,7 @@ #define REG_MACL (21) #define FETCH_LINKPTR(dest) \ - asm("mov r8, %0" : "=rm" (dest)); + asm("mov r8, %0" : "=r" (dest)); #include "common-defs.h" diff --git a/arch/x86/defs.h b/arch/x86/defs.h index 2b0c68d..0bf73ba 100644 --- a/arch/x86/defs.h +++ b/arch/x86/defs.h @@ -60,7 +60,7 @@ #define MCONTEXT_GREGS (20) #define FETCH_LINKPTR(dest) \ - asm("movl (%%esp, %%ebx, 4), %0" : "=rm" ((dest))); + asm("movl (%%esp, %%ebx, 4), %0" : "=r" ((dest))); #include "common-defs.h" diff --git a/arch/x86_64/defs.h b/arch/x86_64/defs.h index 4a53f96..c5fd126 100644 --- a/arch/x86_64/defs.h +++ b/arch/x86_64/defs.h @@ -32,7 +32,7 @@ #define REG_SZ (8) #define FETCH_LINKPTR(dest) \ - asm("movq (%%rbx), %0" : "=rm" ((dest))); + asm("movq (%%rbx), %0" : "=r" ((dest))); #include "common-defs.h"