[metadata] Assorted enhancements for some CIL image formats (#42398)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 18 Sep 2020 13:45:30 +0000 (09:45 -0400)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 13:45:30 +0000 (09:45 -0400)
commit6f72257061fbec6c972b94fd7c8da15903f1e112
treea901b8b9089e0d8278e38ca45c991ad271266aa4
parente6ab549cd871289f8766c3c208294ad13b16643f
[metadata] Assorted enhancements for some CIL image formats (#42398)

Some  cherrypicked changes from a work in progress

* Try to set MonoImage guid from modules table for metadata_only images

   If the image has a modules table, and a guid heap, set MonoImage:guid when loading the image, even if it is metadata_only.  In minimal delta images this is true.

* Minimal delta files have 4 byte indices, always

* Don't populate MonoImage:module_name for minimal deltas

* Always store precise string heap size in MonoImage:heap_strings

   In minimal delta images, the String heap is appended to the heap of the base image.  But in the physical base image, the String heap is zero-padded to a size that's a multiple of 4 bytes.

   Compute the precise String heap size at base image load time.

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
src/mono/mono/metadata/image.c
src/mono/mono/metadata/metadata.c