diff options
author | Martin Storsjö <martin@martin.st> | 2025-10-13 23:01:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-13 23:01:17 +0300 |
commit | 7e690517bceea62a6b9c7e05622fb48bb6316efc (patch) | |
tree | e1019f302b5eb0a5085ccf091eb70225bda5216f /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | e95cedd31be6cc4d9e46ad2e38a77473808e373f (diff) | |
download | llvm-7e690517bceea62a6b9c7e05622fb48bb6316efc.zip llvm-7e690517bceea62a6b9c7e05622fb48bb6316efc.tar.gz llvm-7e690517bceea62a6b9c7e05622fb48bb6316efc.tar.bz2 |
[LLD] [COFF] Fix aarch64 delayimport of sret arguments (#163096)
For sret arguments on aarch64, the x8 register is used as input
parameter to functions, even though x8 normally isn't an input parameter
register.
When delayloading a DLL, the first call of a delayloaded function ends
up calling a helper which resolves the function. Therefore, any input
arguments to the actual function to be called need to be backed up and
restored - this also includes x8.
This matches how MS link.exe also changed its delayloading trampoline,
between MSVC 2019 16.7 and 16.8 (between link.exe 14.27.29110.0 and
14.28.29333.0).
This fixes running LLDB on aarch64 mingw, after
ec28b95b7491bc2fbb6ec66cdbfd939e71255c42 and
93d326038959fd87fb666a8bf97d774d0abb3591. Those commits make LLDB load
liblldb.dll with delayloading, and the first function to be called,
SBDebugger::InitializeWithErrorHandling(), returns an SBError, which in
the itanium C++ ABI is returned as an sret via a pointer in x8.
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
0 files changed, 0 insertions, 0 deletions