Skip to content

Commit

Permalink
Make printValue a member function.
Browse files Browse the repository at this point in the history
We were already passing 3 values it can get from ELFDumper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242829 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Jul 21, 2015
1 parent 961b7c2 commit ca7fac9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/llvm-readobj/ELFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ELFDumper : public ObjDumper {

void printRelocations(const Elf_Shdr *Sec);
void printRelocation(const Elf_Shdr *Sec, typename ELFO::Elf_Rela Rel);
void printValue(uint64_t Type, uint64_t Value);

const ELFO *Obj;
};
Expand Down Expand Up @@ -967,8 +968,8 @@ static const char *getDynamicString(const ELFFile<ELFT> &O, uint64_t Value) {
}

template <class ELFT>
static void printValue(const ELFFile<ELFT> *O, uint64_t Type, uint64_t Value,
bool Is64, raw_ostream &OS) {
void ELFDumper<ELFT>::printValue(uint64_t Type, uint64_t Value) {
raw_ostream &OS = W.getOStream();
switch (Type) {
case DT_PLTREL:
if (Value == DT_REL) {
Expand Down Expand Up @@ -1024,14 +1025,14 @@ static void printValue(const ELFFile<ELFT> *O, uint64_t Type, uint64_t Value,
OS << Value << " (bytes)";
break;
case DT_NEEDED:
OS << "SharedLibrary (" << getDynamicString(*O, Value) << ")";
OS << "SharedLibrary (" << getDynamicString(*Obj, Value) << ")";
break;
case DT_SONAME:
OS << "LibrarySoname (" << getDynamicString(*O, Value) << ")";
OS << "LibrarySoname (" << getDynamicString(*Obj, Value) << ")";
break;
case DT_RPATH:
case DT_RUNPATH:
OS << getDynamicString(*O, Value);
OS << getDynamicString(*Obj, Value);
break;
case DT_MIPS_FLAGS:
printFlags(Value, makeArrayRef(ElfDynamicDTMipsFlags), OS);
Expand Down Expand Up @@ -1098,7 +1099,7 @@ void ELFDumper<ELFT>::printDynamicTable() {
<< " "
<< format(Is64 ? "0x%016" PRIX64 : "0x%08" PRIX64, Entry.getTag())
<< " " << format("%-21s", getTypeString(Entry.getTag()));
printValue(Obj, Entry.getTag(), Entry.getVal(), Is64, OS);
printValue(Entry.getTag(), Entry.getVal());
OS << "\n";
}

Expand Down

0 comments on commit ca7fac9

Please sign in to comment.