From: Yuxuan Shui yshui@codeweavers.com
Discovered while I was working on ASan support. ASan shadow memory might be placed where the main image is normally loaded, forcing it to relocate. `virtual_map_module` handles this correctly but `virtual_map_builtin_module` doesn't. --- dlls/ntdll/unix/virtual.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 202894750a0..e4512dc0d0e 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -3797,6 +3797,8 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size status = virtual_map_image( mapping, module, size, shared_file, limit_low, limit_high, 0, machine, image_info, filename, TRUE ); virtual_fill_image_information( image_info, info ); + if (status == STATUS_IMAGE_NOT_AT_BASE) + info->TransferAddress = (char *)*module + image_info->entry_point; }
if (shared_file) NtClose( shared_file );