summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-12-19 14:48:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-12-19 14:48:05 +0000
commitcd7ee1ced017d7a957113df9d6cf855ecbc3797e (patch)
treed35c143f4fd20a61924564e6a1e2f14e3adfbcc2 /tools
parent35d346294128038794637b384fcc5f97ff3d9978 (diff)
Revert 170545 while I debug the ppc failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-objdump/MachODump.cpp8
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp25
2 files changed, 5 insertions, 28 deletions
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index c324ff13a6..3a350382ae 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/tools/llvm-objdump/MachODump.cpp
@@ -334,15 +334,9 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
for (unsigned SectIdx = 0; SectIdx != Sections.size(); SectIdx++) {
StringRef SectName;
if (Sections[SectIdx].getName(SectName) ||
- SectName != "__text")
+ SectName.compare("__TEXT,__text"))
continue; // Skip non-text sections
- StringRef SegmentName;
- DataRefImpl DR = Sections[SectIdx].getRawDataRefImpl();
- if (MachOOF->getSectionFinalSegmentName(DR, SegmentName) ||
- SegmentName != "__TEXT")
- continue;
-
// Insert the functions from the function starts segment into our map.
uint64_t VMAddr;
Sections[SectIdx].getAddress(VMAddr);
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index 24dc9c91a3..2838a2a2b3 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/tools/llvm-objdump/llvm-objdump.cpp
@@ -28,7 +28,6 @@
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
-#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
@@ -73,9 +72,9 @@ static cl::opt<bool>
SymbolTable("t", cl::desc("Display the symbol table"));
static cl::opt<bool>
-MachOOpt("macho", cl::desc("Use MachO specific object file parser"));
+MachO("macho", cl::desc("Use MachO specific object file parser"));
static cl::alias
-MachOm("m", cl::desc("Alias for --macho"), cl::aliasopt(MachOOpt));
+MachOm("m", cl::desc("Alias for --macho"), cl::aliasopt(MachO));
cl::opt<std::string>
llvm::TripleName("triple", cl::desc("Target triple to disassemble for, "
@@ -242,18 +241,9 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
// Sort relocations by address.
std::sort(Rels.begin(), Rels.end(), RelocAddressLess);
- StringRef SegmentName = "";
- if (const MachOObjectFile *MachO = dyn_cast<const MachOObjectFile>(Obj)) {
- DataRefImpl DR = i->getRawDataRefImpl();
- if (error(MachO->getSectionFinalSegmentName(DR, SegmentName)))
- break;
- }
StringRef name;
if (error(i->getName(name))) break;
- outs() << "Disassembly of section ";
- if (!SegmentName.empty())
- outs() << SegmentName << ",";
- outs() << name << ':';
+ outs() << "Disassembly of section " << name << ':';
// If the section has no symbols just insert a dummy one and disassemble
// the whole section.
@@ -577,13 +567,6 @@ static void PrintSymbolTable(const ObjectFile *o) {
else if (Section == o->end_sections())
outs() << "*UND*";
else {
- if (const MachOObjectFile *MachO = dyn_cast<const MachOObjectFile>(o)) {
- StringRef SegmentName;
- DataRefImpl DR = Section->getRawDataRefImpl();
- if (error(MachO->getSectionFinalSegmentName(DR, SegmentName)))
- SegmentName = "";
- outs() << SegmentName << ",";
- }
StringRef SectionName;
if (error(Section->getName(SectionName)))
SectionName = "";
@@ -657,7 +640,7 @@ static void DumpInput(StringRef file) {
return;
}
- if (MachOOpt && Disassemble) {
+ if (MachO && Disassemble) {
DisassembleInputMachO(file);
return;
}