Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ extern TADDR g_ClrModuleBase;
CRITICAL_SECTION g_dacCritSec;
ClrDataAccess* g_dacImpl;

EXTERN_C
#ifdef TARGET_UNIX
DLLEXPORT // For Win32 PAL LoadLibrary emulation
#endif
BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
EXTERN_C BOOL WINAPI DllMain2(HANDLE instance, DWORD reason, LPVOID reserved)
{
static bool g_procInitialized = false;

Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/debug/daccess/fntableaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class CheckDuplicatedStructLayouts

#else // CHECK_DUPLICATED_STRUCT_LAYOUTS

BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID pReserved);
//NTSTATUS OutOfProcessFindHeader(HANDLE hProcess, DWORD_PTR pMapIn, DWORD_PTR addr, DWORD_PTR &codeHead);
extern "C" NTSTATUS OutOfProcessFunctionTableCallback(IN HANDLE hProcess, IN PVOID TableAddress, OUT PULONG pnEntries, OUT PT_RUNTIME_FUNCTION* ppFunctions);


Expand Down
8 changes: 0 additions & 8 deletions src/coreclr/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ else(CLR_CMAKE_HOST_WIN32)
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)

# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)

set_exports_linker_option(${EXPORTS_FILE})
Expand Down Expand Up @@ -150,10 +146,8 @@ set(COREDAC_LIBRARIES
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
cee_dac
cordbee_dac
${START_WHOLE_ARCHIVE} # force all exports to be available
corguids
daccess
${END_WHOLE_ARCHIVE}
dbgutil
mdcompiler_dac
mdruntime_dac
Expand Down Expand Up @@ -200,10 +194,8 @@ if(CLR_CMAKE_HOST_WIN32)
else(CLR_CMAKE_HOST_WIN32)
list(APPEND COREDAC_LIBRARIES
mscorrc
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
coreclrpal
coreclrminipal
${END_WHOLE_ARCHIVE}
)
endif(CLR_CMAKE_HOST_WIN32)

Expand Down
15 changes: 15 additions & 0 deletions src/coreclr/dlls/mscordac/mscordac.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#include <windows.h>

EXTERN_C BOOL WINAPI DllMain2(HANDLE instance, DWORD reason, LPVOID reserved);

// This is a workaround for missing exports on Linux. Defining DllMain forwarder here makes Linux linker export DllMain and other
// methods built under debug/daccess in the final binary.
EXTERN_C
#ifdef HOST_UNIX
DLLEXPORT // For Win32 PAL LoadLibrary emulation
#endif
BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
{
return DllMain2(instance, reason, reserved);
}