From f2b8af7e7e159a5259aaab42169c4f8220b121eb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 2 Apr 2020 19:18:24 +0200 Subject: [PATCH] dbghelp: Get rid of get_dyld_image_info_address. We should get the address from PEB anyway. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/dbghelp/macho_module.c | 45 +------------------------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 795b8500d9d..8aa232e1ed2 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -37,12 +37,6 @@ #include #include #include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -# include -#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -54,8 +48,6 @@ #ifdef HAVE_MACH_O_LOADER_H -#include - struct dyld_image_info32 { UINT32 imageLoadAddress; /* const struct mach_header* */ @@ -1455,41 +1447,6 @@ static void macho_module_remove(struct process* pcs, struct module_format* modfm HeapFree(GetProcessHeap(), 0, modfmt); } -/****************************************************************** - * get_dyld_image_info_address - */ -static ULONG_PTR get_dyld_image_info_address(struct process* pcs) -{ - ULONG_PTR dyld_image_info_address = 0; - -#ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ - if (!dyld_image_info_address) - { - static void* dyld_all_image_infos_addr; - - /* Our next best guess is that dyld was loaded at its base address - and we can find the dyld image infos address by looking up its symbol. */ - if (!dyld_all_image_infos_addr) - { - struct nlist nl[2]; - memset(nl, 0, sizeof(nl)); - nl[0].n_un.n_name = (char*)"_dyld_all_image_infos"; - if (!nlist("/usr/lib/dyld", nl)) - dyld_all_image_infos_addr = (void*)nl[0].n_value; - } - - if (dyld_all_image_infos_addr) - { - TRACE("got dyld_image_info_address %p from /usr/lib/dyld symbol table\n", - dyld_all_image_infos_addr); - dyld_image_info_address = (ULONG_PTR)dyld_all_image_infos_addr; - } - } -#endif - - return dyld_image_info_address; -} - /****************************************************************** * macho_load_file * @@ -1964,7 +1921,7 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) struct macho_info macho_info; TRACE("(%p/%p)\n", pcs, pcs->handle); - pcs->dbg_hdr_addr = addr ? addr : get_dyld_image_info_address(pcs); + pcs->dbg_hdr_addr = addr; macho_info.flags = MACHO_INFO_MODULE; if (!macho_search_loader(pcs, &macho_info)) return FALSE; macho_info.module->format_info[DFI_MACHO]->u.macho_info->is_loader = 1;