aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-15 00:14:46 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-15 00:14:46 +0000
commitb1d80722a8bd7c81017ed68e68f74ed9b2004932 (patch)
tree18f935140241411fc32086e9bfc2ba67dd3910dc /llvm/lib/Object/MachOObjectFile.cpp
parentc998f71d141aac3d57c2c998da97edbcbf0bca91 (diff)
downloadllvm-b1d80722a8bd7c81017ed68e68f74ed9b2004932.zip
llvm-b1d80722a8bd7c81017ed68e68f74ed9b2004932.tar.gz
llvm-b1d80722a8bd7c81017ed68e68f74ed9b2004932.tar.bz2
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)
llvm-svn: 135228
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 71f1f8c..37edefe 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/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;
}