[PATCH] D59089: [llvm-readobj] Dump DT_USED value as string like GNU readelf does
Xing via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 03:53:42 PST 2019
Higuoxing created this revision.
Higuoxing added a reviewer: jhenderson.
Herald added subscribers: llvm-commits, rupprecht.
Herald added a project: LLVM.
Repository:
rL LLVM
https://reviews.llvm.org/D59089
Files:
test/tools/llvm-readobj/elf-dynamic-tags.test
tools/llvm-readobj/ELFDumper.cpp
Index: tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- tools/llvm-readobj/ELFDumper.cpp
+++ tools/llvm-readobj/ELFDumper.cpp
@@ -1879,6 +1879,9 @@
case DT_FILTER:
printLibrary(OS, "Filter library", getDynamicString(Value));
break;
+ case DT_USED:
+ printLibrary(OS, "Not needed object", getDynamicString(Value));
+ break;
case DT_RPATH:
case DT_RUNPATH:
OS << getDynamicString(Value);
Index: test/tools/llvm-readobj/elf-dynamic-tags.test
===================================================================
--- test/tools/llvm-readobj/elf-dynamic-tags.test
+++ test/tools/llvm-readobj/elf-dynamic-tags.test
@@ -3,7 +3,7 @@
# RUN: llvm-readobj --dynamic-table %t | FileCheck %s --check-prefix=LLVM
# RUN: llvm-readelf --dynamic-table %t | FileCheck %s --check-prefix=GNU
-# LLVM: DynamicSection [ (60 entries)
+# LLVM: DynamicSection [ (61 entries)
# LLVM-NEXT: Tag Type Name/Value
# LLVM-NEXT: 0x0000000000000001 NEEDED Shared library: [D]
# LLVM-NEXT: 0x0000000000000002 PLTRELSZ 16 (bytes)
@@ -61,13 +61,14 @@
# LLVM-NEXT: 0x000000006FFFFFFF VERNEEDNUM 0
# LLVM-NEXT: 0x000000007FFFFFFD AUXILIARY Auxiliary library: [D]
# LLVM-NEXT: 0x000000007FFFFFFF FILTER Filter library: [U]
+# LLVM-NEXT: 0x000000007FFFFFFE USED Not needed object: [U]
# LLVM-NEXT: 0x0000000012345678 unknown 0x8765432187654321
# LLVM-NEXT: 0x000000006ABCDEF0 unknown 0x9988776655443322
# LLVM-NEXT: 0x0000000076543210 unknown 0x5555666677778888
# LLVM-NEXT: 0x0000000000000000 NULL 0x0
# LLVM-NEXT: ]
-# GNU: DynamicSection [ (60 entries)
+# GNU: DynamicSection [ (61 entries)
# GNU-NEXT: Tag Type Name/Value
# GNU-NEXT: 0x0000000000000001 NEEDED Shared library: [D]
# GNU-NEXT: 0x0000000000000002 PLTRELSZ 16 (bytes)
@@ -125,6 +126,7 @@
# GNU-NEXT: 0x000000006fffffff VERNEEDNUM 0
# GNU-NEXT: 0x000000007ffffffd AUXILIARY Auxiliary library: [D]
# GNU-NEXT: 0x000000007fffffff FILTER Filter library: [U]
+# GNU-NEXT: 0x000000007ffffffe USED Not needed object: [U]
# GNU-NEXT: 0x0000000012345678 unknown 0x8765432187654321
# GNU-NEXT: 0x000000006abcdef0 unknown 0x9988776655443322
# GNU-NEXT: 0x0000000076543210 unknown 0x5555666677778888
@@ -259,6 +261,8 @@
Value: 0x1
- Tag: DT_FILTER
Value: 0x3
+ - Tag: DT_USED
+ Value: 0x3
# Show behaviour for unknown values in special and un-marked ranges.
- Tag: 0x12345678
Value: 0x8765432187654321
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59089.189689.patch
Type: text/x-patch
Size: 2865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190307/88f663dd/attachment.bin>
More information about the llvm-commits
mailing list