MachOObjectFile: Change isSectionText to return true for sections named text, not...
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 15 Jul 2011 00:14:46 +0000 (00:14 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 15 Jul 2011 00:14:46 +0000 (00:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135228 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/MachOObjectFile.cpp

index 71f1f8cf4b79babbe7409ffb948b6635891b1a16..37edefe99fa45c8778e76c25f973f94d4768b8b6 100644 (file)
@@ -276,10 +276,9 @@ error_code MachOObjectFile::getSectionContents(DataRefImpl DRI,
 
 error_code MachOObjectFile::isSectionText(DataRefImpl DRI,
                                           bool &Result) const {
-  InMemoryStruct<macho::SegmentLoadCommand> SLC;
-  LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
-  MachOObj->ReadSegmentLoadCommand(LCI, SLC);
-  Result = !strcmp(SLC->Name, "__TEXT");
+  InMemoryStruct<macho::Section> Sect;
+  getSection(DRI, Sect);
+  Result = !strcmp(Sect->Name, "__text");
   return object_error::success;
 }