[all-commits] [llvm/llvm-project] 7b785d: [LLD][COFF] Fix tailMergeARM64 delayload thunk 128...
Martin Storsjö via All-commits
all-commits at lists.llvm.org
Wed Oct 15 02:31:45 PDT 2025
Branch: refs/heads/release/21.x
Home: https://github.com/llvm/llvm-project
Commit: 7b785dcb70f6ab2b8ecf1b75a9fc7cf2512b8ab6
https://github.com/llvm/llvm-project/commit/7b785dcb70f6ab2b8ecf1b75a9fc7cf2512b8ab6
Author: Hans Wennborg <hans at hanshq.net>
Date: 2025-10-15 (Wed, 15 Oct 2025)
Changed paths:
M lld/COFF/DLL.cpp
M lld/test/COFF/arm64-delayimport.yaml
M lld/test/COFF/arm64x-delayimport.test
Log Message:
-----------
[LLD][COFF] Fix tailMergeARM64 delayload thunk 128 MB range limitation (#161844)
lld would fail with "error: relocation out of range" if the thunk was
laid out more than 128 MB away from __delayLoadHelper2.
This patch changes the call sequence to load the offset into a register
and call through that, allowing for 32-bit offsets.
Fixes #161812
(cherry picked from commit 69b8d6d4ead01b88fb8d6642914ca7492e32fdb6)
Commit: bd9bc536b4ac7147142d1fc21915c4e6868f7d15
https://github.com/llvm/llvm-project/commit/bd9bc536b4ac7147142d1fc21915c4e6868f7d15
Author: Martin Storsjö <martin at martin.st>
Date: 2025-10-15 (Wed, 15 Oct 2025)
Changed paths:
M lld/COFF/DLL.cpp
M lld/test/COFF/arm64-delayimport.yaml
M lld/test/COFF/arm64x-delayimport.test
Log Message:
-----------
[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.
(cherry picked from commit 7e690517bceea62a6b9c7e05622fb48bb6316efc)
Compare: https://github.com/llvm/llvm-project/compare/a847f1832857...bd9bc536b4ac
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list