From d187cfee241a18a079064d2bb45c3db6f44a52f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Wed, 24 Mar 2021 15:50:08 -0700 Subject: [PATCH] Fix CoreCLR runtime in the presence of 1-file composite images (#50188) I hit this while creating a regression test for the issue #49982. In the initial composite R2R design I proposed slightly different organization of the header tables when the composite image only comprises a single file; later on I removed this special casing as it was confusing and making the format more complicated but apparently I forgot to fix this runtime bit. When there's a composite image with only one component in it, we weren't properly initializing the component header table and so we were unable to resolve any R2R methods for the composite image. Thanks Tomas --- src/coreclr/vm/readytoruninfo.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/coreclr/vm/readytoruninfo.cpp b/src/coreclr/vm/readytoruninfo.cpp index d91a48ada7323..a7a7e0394a1f4 100644 --- a/src/coreclr/vm/readytoruninfo.cpp +++ b/src/coreclr/vm/readytoruninfo.cpp @@ -635,16 +635,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, LoaderAllocator* pLoaderAllocat // In multi-assembly composite images, per assembly sections are stored next to their core headers. m_pCompositeInfo = pNativeImage->GetReadyToRunInfo(); m_pComposite = m_pCompositeInfo->GetComponentInfo(); - if (pNativeImage->GetComponentAssemblyCount() == 1) - { - // When there's just 1 component assembly in the composite image, we're skipping the - // assembly headers and store all sections directly in the main R2R header. - m_component = *m_pComposite; - } - else - { - m_component = ReadyToRunCoreInfo(m_pComposite->GetLayout(), pNativeImage->GetComponentAssemblyHeader(pModule->GetSimpleName())); - } + m_component = ReadyToRunCoreInfo(m_pComposite->GetLayout(), pNativeImage->GetComponentAssemblyHeader(pModule->GetSimpleName())); m_isComponentAssembly = true; } else