dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

ARM64: fix loading function address in CallingConventionConverter_Get… #8310

Closed RalfKornmannEnvision closed 4 years ago

RalfKornmannEnvision commented 4 years ago

The current way to load the address of a functions there can cause the assembler to add a data field in a executable section itself. Depending on how smart the linker is this might generate position dependent code. In this case the OS might need to patch these data fields after loading. Therefore the linker needs to add relocation information for the code section. A hardened OS can reject to load an file that contains relocation in the executable part for security reasons. 

The new way doesn't have this issue. It is already used for other functions.