diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1990,6 +1990,8 @@ if (e.entry.flags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER) { e.entry.other = data.GetULEB128(&offset); uint64_t resolver_addr = e.entry.other; + if (text_seg_base_addr != LLDB_INVALID_ADDRESS) + resolver_addr += text_seg_base_addr; if (is_arm) resolver_addr &= THUMB_ADDRESS_BIT_MASK; resolver_addresses.insert(resolver_addr); diff --git a/lldb/test/API/macosx/indirect_symbol/Makefile b/lldb/test/API/macosx/indirect_symbol/Makefile --- a/lldb/test/API/macosx/indirect_symbol/Makefile +++ b/lldb/test/API/macosx/indirect_symbol/Makefile @@ -8,7 +8,8 @@ build-libindirect: indirect.c $(MAKE) -f $(MAKEFILE_RULES) \ - DYLIB_C_SOURCES=indirect.c DYLIB_NAME=indirect DYLIB_ONLY=YES + DYLIB_C_SOURCES=indirect.c DYLIB_NAME=indirect DYLIB_ONLY=YES \ + LD_EXTRAS="-Wl,-image_base,0x200000000" build-libreepxoprt: reexport.c $(MAKE) -f $(MAKEFILE_RULES) \