[ros-diffs] [tkreuzer] 53198: [CRT] Add assembly stubs and aliases for c++ symbols for MSVC

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Fri Aug 12 11:43:54 UTC 2011


Author: tkreuzer
Date: Fri Aug 12 11:43:53 2011
New Revision: 53198

URL: http://svn.reactos.org/svn/reactos?rev=53198&view=rev
Log:
[CRT]
Add assembly stubs and aliases for c++ symbols for MSVC

Added:
    trunk/reactos/lib/sdk/crt/except/i386/cpp.s   (with props)
Modified:
    trunk/reactos/lib/sdk/crt/crt.cmake
    trunk/reactos/lib/sdk/crt/except/cpp.c

Modified: trunk/reactos/lib/sdk/crt/crt.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.cmake?rev=53198&r1=53197&r2=53198&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] Fri Aug 12 11:43:53 2011
@@ -314,6 +314,10 @@
         float/i386/logb.c
         float/i386/statfp.c
         setjmp/i386/setjmp.s)
+    if(MSVC)
+        list(APPEND CRT_SOURCE
+            except/i386/cpp.s)
+    endif()
 elseif(ARCH MATCHES amd64)
     list(APPEND CRT_SOURCE
         except/amd64/seh.s

Modified: trunk/reactos/lib/sdk/crt/except/cpp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/cpp.c?rev=53198&r1=53197&r2=53198&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/except/cpp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/except/cpp.c [iso-8859-1] Fri Aug 12 11:43:53 2011
@@ -708,15 +708,6 @@
 #ifndef __GNUC__
 }
 #endif
-#endif
-
-#ifdef _MSC_VER
-#pragma message ("HAXX!")
-const vtable_ptr MSVCRT_exception_vtable;
-const vtable_ptr MSVCRT_bad_typeid_vtable;
-const vtable_ptr MSVCRT_bad_cast_vtable;
-const vtable_ptr MSVCRT___non_rtti_object_vtable;
-const vtable_ptr MSVCRT_type_info_vtable;
 #endif
 
 /* Static RTTI for exported objects */

Added: trunk/reactos/lib/sdk/crt/except/i386/cpp.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/i386/cpp.s?rev=53198&view=auto
==============================================================================
--- trunk/reactos/lib/sdk/crt/except/i386/cpp.s (added)
+++ trunk/reactos/lib/sdk/crt/except/i386/cpp.s [iso-8859-1] Fri Aug 12 11:43:53 2011
@@ -1,0 +1,112 @@
+
+
+#include <asm.inc>
+
+.code
+.align 4
+
+MACRO(DEFINE_THISCALL_WRAPPER, cxxname, stdcallname)
+EXTERN &stdcallname:PROC
+PUBLIC &cxxname
+&cxxname:
+    pop eax
+    push ecx
+    push eax
+    jmp &stdcallname
+ENDM
+
+DEFINE_THISCALL_WRAPPER ??0exception@@QAE at ABQBD@Z, _MSVCRT_exception_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0exception@@QAE at ABQBDH@Z, _MSVCRT_exception_ctor_noalloc at 12
+DEFINE_THISCALL_WRAPPER ??0exception@@QAE at ABV0@@Z, _MSVCRT_exception_copy_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0exception@@QAE at XZ, _MSVCRT_exception_default_ctor at 4
+DEFINE_THISCALL_WRAPPER ??1exception@@UAE at XZ, _MSVCRT_exception_dtor at 4
+DEFINE_THISCALL_WRAPPER ??4exception@@QAEAAV0 at ABV0@@Z, _MSVCRT_exception_opequals at 8
+DEFINE_THISCALL_WRAPPER ??_Eexception@@UAEPAXI at Z, _MSVCRT_exception_vector_dtor at 8
+DEFINE_THISCALL_WRAPPER ??_Gexception@@UAEPAXI at Z, _MSVCRT_exception_scalar_dtor at 8
+DEFINE_THISCALL_WRAPPER ?what at exception@@UBEPBDXZ, _MSVCRT_what_exception at 4
+DEFINE_THISCALL_WRAPPER ??0bad_typeid@@QAE at ABV0@@Z, _MSVCRT_bad_typeid_copy_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0bad_typeid@@QAE at PBD@Z, _MSVCRT_bad_typeid_ctor at 8
+DEFINE_THISCALL_WRAPPER ??_Fbad_typeid@@QAEXXZ, _MSVCRT_bad_typeid_default_ctor at 4
+DEFINE_THISCALL_WRAPPER ??1bad_typeid@@UAE at XZ, _MSVCRT_bad_typeid_dtor at 4
+DEFINE_THISCALL_WRAPPER ??4bad_typeid@@QAEAAV0 at ABV0@@Z, _MSVCRT_bad_typeid_opequals at 8
+DEFINE_THISCALL_WRAPPER ??_Ebad_typeid@@UAEPAXI at Z, _MSVCRT_bad_typeid_vector_dtor at 8
+DEFINE_THISCALL_WRAPPER ??_Gbad_typeid@@UAEPAXI at Z, _MSVCRT_bad_typeid_scalar_dtor at 8
+DEFINE_THISCALL_WRAPPER ??0__non_rtti_object@@QAE at ABV0@@Z, _MSVCRT___non_rtti_object_copy_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0__non_rtti_object@@QAE at PBD@Z, _MSVCRT___non_rtti_object_ctor at 8
+DEFINE_THISCALL_WRAPPER ??1__non_rtti_object@@UAE at XZ, _MSVCRT___non_rtti_object_dtor at 4
+DEFINE_THISCALL_WRAPPER ??4__non_rtti_object@@QAEAAV0 at ABV0@@Z, _MSVCRT___non_rtti_object_opequals at 8
+DEFINE_THISCALL_WRAPPER ??_E__non_rtti_object@@UAEPAXI at Z, _MSVCRT___non_rtti_object_vector_dtor at 8
+DEFINE_THISCALL_WRAPPER ??_G__non_rtti_object@@UAEPAXI at Z, _MSVCRT___non_rtti_object_scalar_dtor at 8
+DEFINE_THISCALL_WRAPPER ??0bad_cast@@AAE at PBQBD@Z, _MSVCRT_bad_cast_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0bad_cast@@QAE at ABQBD@Z, _MSVCRT_bad_cast_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0bad_cast@@QAE at ABV0@@Z, _MSVCRT_bad_cast_copy_ctor at 8
+DEFINE_THISCALL_WRAPPER ??0bad_cast@@QAE at PBD@Z, _MSVCRT_bad_cast_ctor_charptr at 8
+DEFINE_THISCALL_WRAPPER ??_Fbad_cast@@QAEXXZ, _MSVCRT_bad_cast_default_ctor at 4
+DEFINE_THISCALL_WRAPPER ??1bad_cast@@UAE at XZ, _MSVCRT_bad_cast_dtor at 4
+DEFINE_THISCALL_WRAPPER ??4bad_cast@@QAEAAV0 at ABV0@@Z, _MSVCRT_bad_cast_opequals at 8
+DEFINE_THISCALL_WRAPPER ??_Ebad_cast@@UAEPAXI at Z, _MSVCRT_bad_cast_vector_dtor at 8
+DEFINE_THISCALL_WRAPPER ??_Gbad_cast@@UAEPAXI at Z, _MSVCRT_bad_cast_scalar_dtor at 8
+DEFINE_THISCALL_WRAPPER ??8type_info@@QBEHABV0@@Z, _MSVCRT_type_info_opequals_equals at 8
+DEFINE_THISCALL_WRAPPER ??9type_info@@QBEHABV0@@Z, _MSVCRT_type_info_opnot_equals at 8
+DEFINE_THISCALL_WRAPPER ?before at type_info@@QBEHABV1@@Z, _MSVCRT_type_info_before at 8
+DEFINE_THISCALL_WRAPPER ??1type_info@@UAE at XZ, _MSVCRT_type_info_dtor at 4
+DEFINE_THISCALL_WRAPPER ?name at type_info@@QBEPBDXZ, _MSVCRT_type_info_name at 4
+DEFINE_THISCALL_WRAPPER ?raw_name at type_info@@QBEPBDXZ, _MSVCRT_type_info_raw_name at 4
+
+
+#undef _MSVCRT_
+MACRO(START_VTABLE, shortname, cxxname)
+EXTERN _&shortname&_rtti:PROC
+EXTERN ___thiscall_MSVCRT_&shortname&_vector_dtor:PROC
+    .long _&shortname&_rtti
+PUBLIC _MSVCRT_&shortname&_vtable
+_MSVCRT_&shortname&_vtable:
+PUBLIC &cxxname
+&cxxname:
+    .long ___thiscall_MSVCRT_&shortname&_vector_dtor
+ENDM
+
+MACRO(DEFINE_EXCEPTION_VTABLE, shortname, cxxname)
+    START_VTABLE shortname, cxxname
+    EXTERN ___thiscall_MSVCRT_what_exception:PROC
+    .long ___thiscall_MSVCRT_what_exception
+ENDM
+
+START_VTABLE type_info, __dummyname_type_info
+DEFINE_EXCEPTION_VTABLE exception, ??_7exception@@6B@
+DEFINE_EXCEPTION_VTABLE bad_typeid, ??_7bad_typeid@@6B@
+DEFINE_EXCEPTION_VTABLE bad_cast, ??_7bad_cast@@6B@
+DEFINE_EXCEPTION_VTABLE __non_rtti_object, ??_7__non_rtti_object@@6B@
+
+EXTERN _MSVCRT_operator_delete:PROC
+PUBLIC ??3 at YAXPAX@Z
+??3 at YAXPAX@Z:
+    jmp _MSVCRT_operator_delete
+
+EXTERN _MSVCRT_operator_new:PROC
+PUBLIC ??_U at YAPAXI@Z
+??_U at YAPAXI@Z:
+    jmp _MSVCRT_operator_new
+
+
+MACRO(DEFINE_ALIAS, alias, orig, type)
+EXTERN &orig:&type
+ALIAS <&alias> = <&orig>
+ENDM
+
+DEFINE_ALIAS ??_V at YAXPAX@Z, _MSVCRT_operator_delete, PROC
+DEFINE_ALIAS ??2 at YAPAXI@Z, _MSVCRT_operator_new, PROC
+DEFINE_ALIAS ?_query_new_handler@@YAP6AHI at ZXZ, _MSVCRT__query_new_handler, PROC
+DEFINE_ALIAS ?_set_new_handler@@YAP6AHI at ZP6AHI@Z at Z, _MSVCRT__set_new_handler, PROC
+DEFINE_ALIAS ?set_new_handler@@YAP6AXXZP6AXXZ at Z, _MSVCRT_set_new_handler, PROC
+DEFINE_ALIAS ?_query_new_mode@@YAHXZ, _MSVCRT__query_new_mode, PROC
+DEFINE_ALIAS ?_set_new_mode@@YAHH at Z, _MSVCRT__set_new_mode, PROC
+DEFINE_ALIAS ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0 at Z@Z, _MSVCRT__set_se_translator, PROC
+DEFINE_ALIAS ?set_terminate@@YAP6AXXZP6AXXZ at Z, _MSVCRT_set_terminate, PROC
+DEFINE_ALIAS ?set_unexpected@@YAP6AXXZP6AXXZ at Z, _MSVCRT_set_unexpected, PROC
+DEFINE_ALIAS ?terminate@@YAXXZ, _MSVCRT_terminate, PROC
+DEFINE_ALIAS ?unexpected@@YAXXZ, _MSVCRT_unexpected, PROC
+
+
+END
+

Propchange: trunk/reactos/lib/sdk/crt/except/i386/cpp.s
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the Ros-diffs mailing list