[llvm] [aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (PR #121516)
Daniel Paoliello via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 3 14:36:03 PST 2025
dpaoliello wrote:
> As the flag /d2ImportCallOptimization is undocumented, I presume that this format is undocumnted too. This covers two separate formats as far as I can see - the .impcall section contents, which this PR generates, and which the linker consumes. This format is mostly a convention - an agreement between compiler and linker; this currently uses the Imp_Call_V1 identifier. And then secondly, the dynamic relocations that the linker generates, which ends up in the final binary, which is consumed by the windows loader. This format isn't touched upon here (as this only covers code generation, not linking). The format of those dynamic relocations is much more fixed, as it's handled by the OS. Although this is only an optimization, so running on older Windows versions which doesn't recognize it, should be fine too?
Correct on all accounts:
* This PR only adds compiler support, with no linker support.
* The format of this section is only used by the linker and is not present in the final binary.
* The linker uses this to build the "Dynamic Value Relocation Table", and [older versions of Windows will ignore entries in that table it does not understand](https://techcommunity.microsoft.com/blog/windowsosplatform/mitigating-spectre-variant-2-with-retpoline-on-windows/295618#:~:text=Importantly%2C%20the%20kernel%20will%20skip%20over%20any%20DVRT%20entries%20it%20does%20not%20recognize).
https://github.com/llvm/llvm-project/pull/121516
More information about the llvm-commits
mailing list