[PATCH] D72992: [llvm-objdump] - Add column headers for relocation printing
Liad Mordekoviz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 19 01:48:15 PST 2020
liadz0rz created this revision.
liadz0rz added reviewers: jhenderson, Bigcheese.
liadz0rz added a project: LLVM.
Herald added subscribers: llvm-commits, rupprecht, dexonsmith.
This allows us better readability and
compatibility with GNU objdump prints, and allows
for better
https://bugs.llvm.org/show_bug.cgi?id=43941
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72992
Files:
llvm/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1639,6 +1639,11 @@
for (std::pair<SectionRef, std::vector<SectionRef>> &P : SecToRelSec) {
StringRef SecName = unwrapOrError(P.first.getName(), Obj->getFileName());
outs() << "RELOCATION RECORDS FOR [" << SecName << "]:\n";
+ uint32_t offset_padding = (Obj->getBytesInAddress() > 4 ? 16 : 8);
+ uint32_t type_padding = 16;
+ outs() << left_justify("OFFSET", offset_padding) << " "
+ << left_justify("TYPE", type_padding) << " "
+ << "VALUE\n";
for (SectionRef Section : P.second) {
for (const RelocationRef &Reloc : Section.relocations()) {
@@ -1651,8 +1656,9 @@
if (Error E = getRelocationValueString(Reloc, ValueStr))
reportError(std::move(E), Obj->getFileName());
- outs() << format(Fmt.data(), Address) << " " << RelocName << " "
- << ValueStr << "\n";
+ outs() << format(Fmt.data(), Address) << " "
+ << left_justify(RelocName, type_padding) << " " << ValueStr
+ << "\n";
}
}
outs() << "\n";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72992.238976.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200119/cdc61cd8/attachment.bin>
More information about the llvm-commits
mailing list