[PATCH] D113206: [llvm-readobj] Display DT_RELRSZ/DT_RELRENT as " (bytes)"

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 10:53:21 PDT 2021


MaskRay created this revision.
MaskRay added a reviewer: jhenderson.
Herald added subscribers: rupprecht, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

to match RELSZ/RELENT.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113206

Files:
  llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
  llvm/tools/llvm-readobj/ELFDumper.cpp


Index: llvm/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -2298,6 +2298,8 @@
   case DT_INIT_ARRAYSZ:
   case DT_FINI_ARRAYSZ:
   case DT_PREINIT_ARRAYSZ:
+  case DT_RELRSZ:
+  case DT_RELRENT:
   case DT_ANDROID_RELSZ:
   case DT_ANDROID_RELASZ:
     return std::to_string(Value) + " (bytes)";
Index: llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
===================================================================
--- llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
+++ llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
@@ -44,9 +44,9 @@
 # LLVM64-NEXT:  0x0000000000000020 PREINIT_ARRAY        0x1000
 # LLVM64-NEXT:  0x0000000000000021 PREINIT_ARRAYSZ      16 (bytes)
 # LLVM64-NEXT:  0x0000000000000022 SYMTAB_SHNDX         0x1000
-# LLVM64-NEXT:  0x0000000000000023 RELRSZ               0x10
+# LLVM64-NEXT:  0x0000000000000023 RELRSZ               16 (bytes)
 # LLVM64-NEXT:  0x0000000000000024 RELR                 0x1000
-# LLVM64-NEXT:  0x0000000000000025 RELRENT              0x4321
+# LLVM64-NEXT:  0x0000000000000025 RELRENT              17185 (bytes)
 # LLVM64-NEXT:  0x000000006000000F ANDROID_REL          0x1000
 # LLVM64-NEXT:  0x0000000060000010 ANDROID_RELSZ        16 (bytes)
 # LLVM64-NEXT:  0x0000000060000011 ANDROID_RELA         0x1000
@@ -109,9 +109,9 @@
 # GNU64-NEXT:  0x0000000000000020 (PREINIT_ARRAY)        0x1000
 # GNU64-NEXT:  0x0000000000000021 (PREINIT_ARRAYSZ)      16 (bytes)
 # GNU64-NEXT:  0x0000000000000022 (SYMTAB_SHNDX)         0x1000
-# GNU64-NEXT:  0x0000000000000023 (RELRSZ)               0x10
+# GNU64-NEXT:  0x0000000000000023 (RELRSZ)               16 (bytes)
 # GNU64-NEXT:  0x0000000000000024 (RELR)                 0x1000
-# GNU64-NEXT:  0x0000000000000025 (RELRENT)              0x4321
+# GNU64-NEXT:  0x0000000000000025 (RELRENT)              17185 (bytes)
 # GNU64-NEXT:  0x000000006000000f (ANDROID_REL)          0x1000
 # GNU64-NEXT:  0x0000000060000010 (ANDROID_RELSZ)        16 (bytes)
 # GNU64-NEXT:  0x0000000060000011 (ANDROID_RELA)         0x1000
@@ -335,9 +335,9 @@
 # LLVM32-NEXT:  0x00000020 PREINIT_ARRAY        0x1000
 # LLVM32-NEXT:  0x00000021 PREINIT_ARRAYSZ      16 (bytes)
 # LLVM32-NEXT:  0x00000022 SYMTAB_SHNDX         0x1000
-# LLVM32-NEXT:  0x00000023 RELRSZ               0x10
+# LLVM32-NEXT:  0x00000023 RELRSZ               16 (bytes)
 # LLVM32-NEXT:  0x00000024 RELR                 0x1000
-# LLVM32-NEXT:  0x00000025 RELRENT              0x4321
+# LLVM32-NEXT:  0x00000025 RELRENT              17185 (bytes)
 # LLVM32-NEXT:  0x6000000F ANDROID_REL          0x1000
 # LLVM32-NEXT:  0x60000010 ANDROID_RELSZ        16 (bytes)
 # LLVM32-NEXT:  0x60000011 ANDROID_RELA         0x1000
@@ -400,9 +400,9 @@
 # GNU32-NEXT:  0x00000020 (PREINIT_ARRAY)        0x1000
 # GNU32-NEXT:  0x00000021 (PREINIT_ARRAYSZ)      16 (bytes)
 # GNU32-NEXT:  0x00000022 (SYMTAB_SHNDX)         0x1000
-# GNU32-NEXT:  0x00000023 (RELRSZ)               0x10
+# GNU32-NEXT:  0x00000023 (RELRSZ)               16 (bytes)
 # GNU32-NEXT:  0x00000024 (RELR)                 0x1000
-# GNU32-NEXT:  0x00000025 (RELRENT)              0x4321
+# GNU32-NEXT:  0x00000025 (RELRENT)              17185 (bytes)
 # GNU32-NEXT:  0x6000000f (ANDROID_REL)          0x1000
 # GNU32-NEXT:  0x60000010 (ANDROID_RELSZ)        16 (bytes)
 # GNU32-NEXT:  0x60000011 (ANDROID_RELA)         0x1000
@@ -530,9 +530,9 @@
 # PHENTSIZE-LLVM-NEXT:   0x0000000000000020 PREINIT_ARRAY        0x1000
 # PHENTSIZE-LLVM-NEXT:   0x0000000000000021 PREINIT_ARRAYSZ      16 (bytes)
 # PHENTSIZE-LLVM-NEXT:   0x0000000000000022 SYMTAB_SHNDX         0x1000
-# PHENTSIZE-LLVM-NEXT:   0x0000000000000023 RELRSZ               0x10
+# PHENTSIZE-LLVM-NEXT:   0x0000000000000023 RELRSZ               16 (bytes)
 # PHENTSIZE-LLVM-NEXT:   0x0000000000000024 RELR                 0x1000
-# PHENTSIZE-LLVM-NEXT:   0x0000000000000025 RELRENT              0x4321
+# PHENTSIZE-LLVM-NEXT:   0x0000000000000025 RELRENT              17185 (bytes)
 # PHENTSIZE-LLVM-NEXT:   0x000000006000000F ANDROID_REL          0x1000
 # PHENTSIZE-LLVM-NEXT:   0x0000000060000010 ANDROID_RELSZ        16 (bytes)
 # PHENTSIZE-LLVM-NEXT:   0x0000000060000011 ANDROID_RELA         0x1000
@@ -596,9 +596,9 @@
 # PHENTSIZE-GNU-NEXT:   0x0000000000000020 (PREINIT_ARRAY)        0x1000
 # PHENTSIZE-GNU-NEXT:   0x0000000000000021 (PREINIT_ARRAYSZ)      16 (bytes)
 # PHENTSIZE-GNU-NEXT:   0x0000000000000022 (SYMTAB_SHNDX)         0x1000
-# PHENTSIZE-GNU-NEXT:   0x0000000000000023 (RELRSZ)               0x10
+# PHENTSIZE-GNU-NEXT:   0x0000000000000023 (RELRSZ)               16 (bytes)
 # PHENTSIZE-GNU-NEXT:   0x0000000000000024 (RELR)                 0x1000
-# PHENTSIZE-GNU-NEXT:   0x0000000000000025 (RELRENT)              0x4321
+# PHENTSIZE-GNU-NEXT:   0x0000000000000025 (RELRENT)              17185 (bytes)
 # PHENTSIZE-GNU-NEXT:   0x000000006000000f (ANDROID_REL)          0x1000
 # PHENTSIZE-GNU-NEXT:   0x0000000060000010 (ANDROID_RELSZ)        16 (bytes)
 # PHENTSIZE-GNU-NEXT:   0x0000000060000011 (ANDROID_RELA)         0x1000


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113206.384813.patch
Type: text/x-patch
Size: 5172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/c5ab5ca5/attachment.bin>


More information about the llvm-commits mailing list