Teach MachO which sections contain code

llvm-svn: 170349
This commit is contained in:
Tim Northover
2012-12-17 17:59:32 +00:00
parent 926758ba45
commit 5edabc131a
5 changed files with 10 additions and 3 deletions

View File

@@ -559,11 +559,11 @@ error_code MachOObjectFile::isSectionText(DataRefImpl DRI,
if (is64BitLoadCommand(MachOObj.get(), DRI)) {
InMemoryStruct<macho::Section64> Sect;
getSection64(DRI, Sect);
Result = !strcmp(Sect->Name, "__text");
Result = Sect->Flags & macho::SF_PureInstructions;
} else {
InMemoryStruct<macho::Section> Sect;
getSection(DRI, Sect);
Result = !strcmp(Sect->Name, "__text");
Result = Sect->Flags & macho::SF_PureInstructions;
}
return object_error::success;
}