msvcrt: Avoid truncated relocations on 64-bit.
authorAlexandre Julliard <julliard@winehq.org>
Thu, 11 Dec 2008 23:05:07 +0000 (00:05 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 12 Dec 2008 09:20:53 +0000 (10:20 +0100)
dlls/msvcrt/cpp.c

index a8687e3de112faea73448d0d1f55b92ddddfb6ac..6bc6d3d4cc9b9020d9ae606144fe310148e460cf 100644 (file)
@@ -624,6 +624,22 @@ void * __stdcall MSVCRT_type_info_vector_dtor(type_info * _this, unsigned int fl
 
 /* vtables */
 
+#ifdef _WIN64
+
+#define __ASM_VTABLE(name,funcs) \
+    __asm__(".data\n" \
+            "\t.align 8\n" \
+            "\t.quad " __ASM_NAME(#name "_rtti") "\n" \
+            "\t.globl " __ASM_NAME("MSVCRT_" #name "_vtable") "\n" \
+            __ASM_NAME("MSVCRT_" #name "_vtable") ":\n" \
+            "\t.quad " THISCALL_NAME(MSVCRT_ ## name ## _vector_dtor) "\n" \
+            funcs "\n\t.text");
+
+#define __ASM_EXCEPTION_VTABLE(name) \
+    __ASM_VTABLE(name, "\t.quad " THISCALL_NAME(MSVCRT_what_exception) )
+
+#else
+
 #define __ASM_VTABLE(name,funcs) \
     __asm__(".data\n" \
             "\t.align 4\n" \
@@ -636,6 +652,8 @@ void * __stdcall MSVCRT_type_info_vector_dtor(type_info * _this, unsigned int fl
 #define __ASM_EXCEPTION_VTABLE(name) \
     __ASM_VTABLE(name, "\t.long " THISCALL_NAME(MSVCRT_what_exception) )
 
+#endif /* _WIN64 */
+
 #ifndef __GNUC__
 void __asm_dummy_vtables(void) {
 #endif