Ensure the module slot in R2R image can be located (dotnet/coreclr#7875)
authorJohn Chen <jochen@microsoft.com>
Fri, 28 Oct 2016 18:48:58 +0000 (11:48 -0700)
committerGitHub <noreply@github.com>
Fri, 28 Oct 2016 18:48:58 +0000 (11:48 -0700)
commitda315abcebdddb13216708b7a2624254c07d6893
tree33ba5e47952daae8fc45f5023ed8fab83c842fa9
parentd28c35e329a8a0dc680421933f7787ba34d221fa
Ensure the module slot in R2R image can be located (dotnet/coreclr#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 dotnet/coreclr#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.

Commit migrated from https://github.com/dotnet/coreclr/commit/7d945336a9307eaaf59f985e4ec2c1b5b8c052b4
src/coreclr/src/vm/readytoruninfo.cpp
src/coreclr/src/zap/zapimage.cpp
src/coreclr/src/zap/zapreadytorun.cpp