[llvm] r269368 - llvm-readobj: Change Hex output for GNU style dynamic table print
Hemant Kulkarni via llvm-commits
llvm-commits at lists.llvm.org
Thu May 12 15:16:53 PDT 2016
Author: khemant
Date: Thu May 12 17:16:53 2016
New Revision: 269368
URL: http://llvm.org/viewvc/llvm-project?rev=269368&view=rev
Log:
llvm-readobj: Change Hex output for GNU style dynamic table print
Dynamic table when printed shows uppercase tag/values.
This changes it to lower case when printing in GNU style
Modified:
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=269368&r1=269367&r2=269368&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Thu May 12 17:16:53 2016
@@ -1578,6 +1578,7 @@ StringRef ELFDumper<ELFT>::getDynamicStr
template <class ELFT>
void ELFDumper<ELFT>::printValue(uint64_t Type, uint64_t Value) {
raw_ostream &OS = W.getOStream();
+ const char* ConvChar = (opts::Output == opts::GNU) ? "0x%" PRIx64 : "0x%" PRIX64;
switch (Type) {
case DT_PLTREL:
if (Value == DT_REL) {
@@ -1612,7 +1613,7 @@ void ELFDumper<ELFT>::printValue(uint64_
case DT_MIPS_RLD_MAP_REL:
case DT_MIPS_PLTGOT:
case DT_MIPS_OPTIONS:
- OS << format("0x%" PRIX64, Value);
+ OS << format(ConvChar, Value);
break;
case DT_RELACOUNT:
case DT_RELCOUNT:
@@ -1656,7 +1657,7 @@ void ELFDumper<ELFT>::printValue(uint64_
printFlags(Value, makeArrayRef(ElfDynamicDTFlags1), OS);
break;
default:
- OS << format("0x%" PRIX64, Value);
+ OS << format(ConvChar, Value);
break;
}
}
@@ -1709,7 +1710,7 @@ void ELFDumper<ELFT>::printDynamicTable(
const Elf_Dyn &Entry = *I;
uintX_t Tag = Entry.getTag();
++I;
- W.startLine() << " " << format_hex(Tag, Is64 ? 18 : 10, true) << " "
+ W.startLine() << " " << format_hex(Tag, Is64 ? 18 : 10, opts::Output != opts::GNU) << " "
<< format("%-21s", getTypeString(Tag));
printValue(Tag, Entry.getVal());
OS << "\n";
More information about the llvm-commits
mailing list