[PATCH 1/2] ntdll: Read auxillary vector directly as fallback.
rbernon at codeweavers.com
Fri Jul 31 08:25:06 CDT 2020
On 2020-07-31 11:51, Rémi Bernon wrote:
> When getauxval isn't available we can read the auxillary vector after
> environment pointers according to System V ABI.
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> I'm not sure if this is very useful, but some runtimes (steamrt for
> instance) have old glibc where getauxval isn't available and it then
> causes SymInitializeW to fail because of NULL process image addresses.
> dlls/ntdll/unix/loader.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
> index bd3a0958757..02ffc0ca775 100644
> --- a/dlls/ntdll/unix/loader.c
> +++ b/dlls/ntdll/unix/loader.c
> @@ -1343,6 +1343,27 @@ ULONG_PTR get_image_address(void)
> if (task_info(mach_task_self(), TASK_DYLD_INFO, (task_info_t)&dyld_info, &size) == KERN_SUCCESS)
> return dyld_info.all_image_info_addr;
> +#elif defined(__linux__)
> + ULONG_PTR size, num, phdr_addr;
> + ElfW(Phdr) *phdr;
> + Elf64_auxv_t *auxp;
> + char **envp = main_envp;
> + while (*envp++ != NULL);
> + for (auxp = (Elf64_auxv_t *)envp; auxp->a_type != 0; auxp++)
And this is obviously 64bit specific, please ignore it.
Rémi Bernon <rbernon at codeweavers.com>
More information about the wine-devel