diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-15 00:14:46 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-15 00:14:46 +0000 |
commit | 82ba5b7c40add3d8d7516d81b9ff288545b821fc (patch) | |
tree | f21498f63cae223a604c3e061a00bb6f1d21bd7f /lib/Object/MachOObjectFile.cpp | |
parent | 79a6a48851e9765bd01ac60be93f8fea22f30f4a (diff) |
MachOObjectFile: Change isSectionText to return true for sections named text, not for load commands name __TEXT (which isn't the case in actual object files)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | lib/Object/MachOObjectFile.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index 71f1f8cf4b..37edefe99f 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -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; } |