Don't wait for the dynamic loader to set a module as a dynamic link editor, figure it out through the ObjectFile.

Background: dyld binaries often have extra symbols in their symbol table like "malloc" and "free" for the early bringup of dyld and we often don't want to set breakpoints in dynamic linker binaries. We also don't want to call the "malloc" or "free" function in dyld when a user writes an expression like "(void *)malloc(123)" so we need to avoid doing name lookups in dyld. We mark Modules as being dynamic link editors and this helps do correct lookups for breakpoints by name and function lookups.

<rdar://problem/19716267>

llvm-svn: 228261
This commit is contained in:
Greg Clayton
2015-02-05 02:01:34 +00:00
parent 50ad727051
commit 08928f308b
6 changed files with 40 additions and 20 deletions

View File

@@ -5296,6 +5296,12 @@ ObjectFileMachO::GetSDKVersion(uint32_t *versions, uint32_t num_versions)
}
bool
ObjectFileMachO::GetIsDynamicLinkEditor()
{
return m_header.filetype == llvm::MachO::MH_DYLINKER;
}
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------