Imported functions in ARM64EC have two `__imp_` symbols: - The usual `__imp_` symbol, which is guaranteed to be directly callable from ARM64 code and is used when calling the function (this may be a thunk if the imported function is x86_64). - The `__imp_aux_` symbol, which is the exact pointer as returned by `GetProcAddress` (it could point to an x86_64 function or the export thunk of an ARM64EC function).
When C code retrieves the address of a function, it uses `__imp_aux_` instead of `__imp_`. This is reflected in `__ASM_DEFINE_IMPORT` by defining `__imp_` to the mangled function name and `__imp_aux_` to the demangled one.
We currently don't depend on it in Wine itself, but it makes the whole thing more correct. Tested by adding `trace("%p\n", exp2);` to msvcrt tests.
From: Jacek Caban jacek@codeweavers.com
--- include/wine/asm.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/wine/asm.h b/include/wine/asm.h index 8c0f4f3361e..6cf75225fd7 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -109,7 +109,18 @@ /* import variables */
#ifdef __WINE_PE_BUILD -# ifdef _WIN64 +# ifdef __arm64ec__ +# define __ASM_DEFINE_IMPORT(name) \ + asm( ".data\n\t" \ + ".balign 8\n\t" \ + ".globl __imp_" name "\n" \ + "__imp_" name ":\n\t" \ + ".quad "#" name ""\n\t" \ + ".globl __imp_aux_" name "\n" \ + "__imp_aux_" name ":\n\t" \ + ".quad " name "\n\t" \ + ".text" ); +# elif defined(_WIN64) # define __ASM_DEFINE_IMPORT(name) \ __ASM_BLOCK_BEGIN(__LINE__) \ asm( ".data\n\t" \
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148402
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000007B00DA, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032