Replace PAL_GetCoreClrModuleBase() with PAL_GetPalModuleBase()
authorEugene Zemtsov <e.zemtsov@gmail.com>
Mon, 23 Mar 2015 00:07:17 +0000 (17:07 -0700)
committerEugene Zemtsov <e.zemtsov@gmail.com>
Mon, 23 Mar 2015 00:07:17 +0000 (17:07 -0700)
src/debug/ee/dactable.cpp
src/pal/inc/pal.h
src/pal/src/loader/module.cpp

index 43b2799..019e1dd 100644 (file)
@@ -53,7 +53,7 @@ DacGlobals g_dacTable;
 // DAC global pointer table initialization
 void DacGlobals::Initialize()
 {
-    TADDR baseAddress = PTR_TO_TADDR(PAL_GetCoreClrModuleBase());
+    TADDR baseAddress = PTR_TO_TADDR(PAL_GetPalModuleBase());
     g_dacTable.InitializeEntries(baseAddress);
 #ifdef FEATURE_SVR_GC
     g_dacTable.InitializeSVREntries(baseAddress);
index 3bf8df0..3e7ae63 100644 (file)
@@ -3335,14 +3335,7 @@ GetModuleFileNameW(
 #define GetModuleFileName GetModuleFileNameA
 #endif
 
-// Get base address of the coreclr module
-PALAPI
-LPCVOID
-PAL_GetCoreClrModuleBase();
-
-
 // Get base address of the module containing this function 
-// (in case of CoreCLR process PAL_GetPalModuleBase() == PAL_GetCoreClrModuleBase())
 PALAPI
 LPCVOID
 PAL_GetPalModuleBase();
index 34bd9d1..ca686ee 100644 (file)
@@ -1906,53 +1906,7 @@ BOOL LOADInitCoreCLRModules()
     return g_pRuntimeDllMain((HMODULE)&pal_module, DLL_PROCESS_ATTACH, NULL);
 }
 
-// Get base address of the coreclr module
-PALAPI
-LPCVOID
-PAL_GetCoreClrModuleBase()
-{
-    LPCVOID retval = NULL;
-
-    PERF_ENTRY(PAL_GetCoreClrModuleBase);
-    ENTRY("PAL_GetCoreClrModuleBase\n");
-
-    if(pal_module.dl_handle != NULL)
-    {
-        // To lookup module base address, we need an address inside of the module.
-        // The coreclr.so contains the DllMain function, so we use it here.
-        void* dllMain = dlsym(pal_module.dl_handle, "DllMain");
-        if (dllMain != NULL)
-        {
-            Dl_info info;
-            if (dladdr(dllMain, &info) != 0)
-            {
-                retval = info.dli_fbase;
-            }
-            else 
-            {
-                TRACE("Can't get base address of the libcoreclr.so\n");
-                SetLastError(ERROR_INVALID_DATA);
-            }
-        }
-        else
-        {
-            TRACE("Can't find DllMain in libcoreclr.so\n");
-            SetLastError(ERROR_INVALID_DATA);
-        }
-    }
-    else 
-    {
-        TRACE("Can't get libcoreclr.so base - the pal_module is not initialized\n");
-        SetLastError(ERROR_MOD_NOT_FOUND);
-    }
-
-    LOGEXIT("PAL_GetCoreClrModuleBase returns %p\n", retval);
-    PERF_EXIT(PAL_GetCoreClrModuleBase);
-    return retval;
-}
-
 // Get base address of the module containing this function 
-// (in case of CoreCLR process PAL_GetPalModuleBase() == PAL_GetCoreClrModuleBase())
 PALAPI
 LPCVOID
 PAL_GetPalModuleBase()