summaryrefslogtreecommitdiff
path: root/src/vm/methodtablebuilder.cpp
diff options
context:
space:
mode:
authorMorgan Brown <morganbr@users.noreply.github.com>2018-08-28 17:29:40 -0700
committerGitHub <noreply@github.com>2018-08-28 17:29:40 -0700
commit246ae784b826c79098a1b3967083c66187786197 (patch)
tree67b21a573bb1d89ba446f8a5bf38d077d35bed1e /src/vm/methodtablebuilder.cpp
parent68a1167f6d12ca10ce6ce6ec9d3951e59912e4ce (diff)
downloadcoreclr-246ae784b826c79098a1b3967083c66187786197.tar.gz
coreclr-246ae784b826c79098a1b3967083c66187786197.tar.bz2
coreclr-246ae784b826c79098a1b3967083c66187786197.zip
Enable mixed mode assembly loading (#19542)
Bring back functionality for loading IJW assemblies and calling managed->native. Also add workaround to test case for the C++ compiler inserting calls to mscoree.
Diffstat (limited to 'src/vm/methodtablebuilder.cpp')
-rw-r--r--src/vm/methodtablebuilder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index 08474ad3cf..cb3012f1e9 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -5955,6 +5955,13 @@ MethodTableBuilder::InitMethodDesc(
pNewNMD->ndirect.m_cbStackArgumentSize = 0xFFFF;
#endif // defined(_TARGET_X86_)
+ // If the RVA of a native method is set, this is an early-bound IJW call
+ if (RVA != 0 && IsMiUnmanaged(dwImplFlags) && IsMiNative(dwImplFlags))
+ {
+ // Note that we cannot initialize the stub directly now in the general case,
+ // as LoadLibrary may not have been performed yet.
+ pNewNMD->SetIsEarlyBound();
+ }
pNewNMD->GetWriteableData()->m_pNDirectTarget = pNewNMD->GetNDirectImportThunkGlue()->GetEntrypoint();
}