summaryrefslogtreecommitdiff
path: root/src/zap/zapimage.cpp
diff options
context:
space:
mode:
authorJohn Chen <jochen@microsoft.com>2016-10-28 11:48:58 -0700
committerGitHub <noreply@github.com>2016-10-28 11:48:58 -0700
commit7d945336a9307eaaf59f985e4ec2c1b5b8c052b4 (patch)
tree9fdee4004e8fffb50e5d063aacf1fab72b1d5ed5 /src/zap/zapimage.cpp
parentdfcc8d72d9e11af945c7dff80f923ba0575f158c (diff)
downloadcoreclr-7d945336a9307eaaf59f985e4ec2c1b5b8c052b4.tar.gz
coreclr-7d945336a9307eaaf59f985e4ec2c1b5b8c052b4.tar.bz2
coreclr-7d945336a9307eaaf59f985e4ec2c1b5b8c052b4.zip
Ensure the module slot in R2R image can be located (#7875)
Each Ready-to-Run image has a slot for storing a pointer to the Module object associated with this image. However, if the image contains no code (e.g., facade assemblies), the import table needed to locate this slot wasn't written out, so the runtime couldn't find this slot. This casued "crossgen /createpdb" command to fail on facade assemblies after PR #7809, and required a workaround (commit c4d8994). This commit ensures writing the import table needed to locate the slot for module. It also removes the workaround in commit c4d8994, which is no longer necessary.
Diffstat (limited to 'src/zap/zapimage.cpp')
-rw-r--r--src/zap/zapimage.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp
index a6f80d2540..f39b8f8f54 100644
--- a/src/zap/zapimage.cpp
+++ b/src/zap/zapimage.cpp
@@ -291,6 +291,12 @@ void ZapImage::InitializeSectionsForReadyToRun()
// Always allocate slot for module - it is used to determine that the image is used
//
m_pImportTable->GetPlacedHelperImport(READYTORUN_HELPER_Module);
+
+ //
+ // Make sure the import sections table is in the image, so we can find the slot for module
+ //
+ _ASSERTE(m_pImportSectionsTable->GetSize() != 0);
+ GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_IMPORT_SECTIONS, m_pImportSectionsTable);
}
#endif // FEATURE_READYTORUN_COMPILER