[PATCH] D58763: [llvm-objdump] Should print unknown d_tag in hex format
Xing via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 27 23:51:10 PST 2019
Higuoxing created this revision.
Higuoxing added reviewers: grimar, jhenderson.
Herald added subscribers: llvm-commits, rupprecht.
Herald added a project: LLVM.
Currently, `llvm-objdump` prints "unknown" instead of d_tag value in hex format. Because getDynamicTagAsString returns "unknown" rather than empty
string.
Repository:
rL LLVM
https://reviews.llvm.org/D58763
Files:
test/tools/llvm-objdump/elf-dynamic-section.test
tools/llvm-objdump/ELFDump.cpp
Index: tools/llvm-objdump/ELFDump.cpp
===================================================================
--- tools/llvm-objdump/ELFDump.cpp
+++ tools/llvm-objdump/ELFDump.cpp
@@ -178,7 +178,7 @@
StringRef Str = StringRef(Elf->getDynamicTagAsString(Dyn.d_tag));
- if (Str.empty()) {
+ if (Str == "unknown") {
std::string HexStr = utohexstr(static_cast<uint64_t>(Dyn.d_tag), true);
outs() << format(" 0x%-19s", HexStr.c_str());
} else {
Index: test/tools/llvm-objdump/elf-dynamic-section.test
===================================================================
--- test/tools/llvm-objdump/elf-dynamic-section.test
+++ test/tools/llvm-objdump/elf-dynamic-section.test
@@ -58,6 +58,7 @@
# CHECK-NEXT: VERNEEDNUM 0x0000000000000000
# CHECK-NEXT: AUXILIARY D
# CHECK-NEXT: FILTER U
+# CHECK-NEXT: 0x12345678 0x0000000087654321
--- !ELF
FileHeader:
@@ -188,6 +189,8 @@
Value: 0x1
- Tag: DT_FILTER
Value: 0x3
+ - Tag: 0x12345678
+ Value: 0x0000000087654321
- Tag: DT_NULL
Value: 0x0
ProgramHeaders:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58763.188680.patch
Type: text/x-patch
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190228/a85225aa/attachment.bin>
More information about the llvm-commits
mailing list