From: Eugene Zemtsov Date: Mon, 23 Mar 2015 00:07:17 +0000 (-0700) Subject: Replace PAL_GetCoreClrModuleBase() with PAL_GetPalModuleBase() X-Git-Tag: accepted/tizen/base/20180629.140029~6947^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7376d1fe614a6512329628e0982298d17e68a38;p=platform%2Fupstream%2Fcoreclr.git Replace PAL_GetCoreClrModuleBase() with PAL_GetPalModuleBase() --- diff --git a/src/debug/ee/dactable.cpp b/src/debug/ee/dactable.cpp index 43b2799..019e1dd 100644 --- a/src/debug/ee/dactable.cpp +++ b/src/debug/ee/dactable.cpp @@ -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); diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 3bf8df0..3e7ae63 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -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(); diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp index 34bd9d1..ca686ee 100644 --- a/src/pal/src/loader/module.cpp +++ b/src/pal/src/loader/module.cpp @@ -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()