Fix DynamicLoaderMacOSXDYLD to deal with new shared cache changes.

<rdar://problem/20357466>

llvm-svn: 233714
This commit is contained in:
Greg Clayton
2015-03-31 17:02:36 +00:00
parent 1ded220cc0
commit 581186ce39

View File

@@ -1266,7 +1266,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImage
// Iterate through the object file sections to find the
// first section that starts of file offset zero and that
// has bytes in the file...
if (dylib_info.segments[i].fileoff == 0 && dylib_info.segments[i].filesize > 0)
if ((dylib_info.segments[i].fileoff == 0 && dylib_info.segments[i].filesize > 0) || (dylib_info.segments[i].name == ConstString("__TEXT")))
{
dylib_info.slide = dylib_info.address - dylib_info.segments[i].vmaddr;
// We have found the slide amount, so we can exit