Allow execution of R2R code in singlefile app on windows. (#40104)
authorVladimir Sadov <vsadov@microsoft.com>
Thu, 6 Aug 2020 22:00:33 +0000 (15:00 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 22:00:33 +0000 (15:00 -0700)
commit9b2f548c3b0da290bc57f1a0460cd0c5c408095e
tree0a16373544b1971cc903cf7676a6dcdf3d17723d
parenta1da393cac02d0588ae499f68d37a3d6e07572f7
Allow execution of R2R code in singlefile app on windows. (#40104)

* Keep executable PE sections executable in LayoutILOnly.

* Install unwind handlers if present

* do not do RtlAddFunctionTable on x86

* Check for Cor header before checking for R2R header.

* Delete function table in image dtor

* Avoid PAGE_EXECUTE_READWRITE, we should not need writeable for R2R

* Do relocations in ConvertedImageLayout only if the file is in a bundle. (otherwise R2R stays disabled)
src/coreclr/src/utilcode/pedecoder.cpp
src/coreclr/src/vm/peimagelayout.cpp
src/coreclr/src/vm/peimagelayout.h