fix breakage in x32 dynamic linker due to mismatching register size
authorRich Felker <dalias@aerifal.cx>
Mon, 20 Apr 2015 22:17:48 +0000 (18:17 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 20 Apr 2015 22:17:48 +0000 (18:17 -0400)
the jmp instruction requires a 64-bit register, so cast the desired PC
address up to uint64_t, going through uintptr_t to ensure that it's
zero-extended rather than possibly sign-extended.

arch/x32/reloc.h

index 7c72d266201df60a28cc7a2c1f3066ca93651641..574f44a777227fa9d0faf3e948a8e4838772651f 100644 (file)
@@ -23,4 +23,4 @@
 #define REL_TPOFF       R_X86_64_TPOFF64
 
 #define CRTJMP(pc,sp) __asm__ __volatile__( \
-       "mov %1,%%esp ; jmp *%0" : : "r"(pc), "r"(sp) : "memory" )
+       "mov %1,%%esp ; jmp *%0" : : "r"((uint64_t)(uintptr_t)pc), "r"(sp) : "memory" )