[PATCH] D65847: [llvm-readelf] --notes: move 'Data size' column left by 1

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 02:12:27 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL368138: [llvm-readelf] --notes: move 'Data size' column left by 1 (authored by MaskRay, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65847/new/

https://reviews.llvm.org/D65847

Files:
  llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
  llvm/trunk/tools/llvm-readobj/ELFDumper.cpp


Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
@@ -4315,7 +4315,7 @@
                          const typename ELFT::Addr Size) {
     OS << "Displaying notes found at file offset " << format_hex(Offset, 10)
        << " with length " << format_hex(Size, 10) << ":\n"
-       << "  Owner                 Data size\tDescription\n";
+       << "  Owner                Data size \tDescription\n";
   };
 
   auto ProcessNote = [&](const Elf_Note &Note) {
@@ -4323,7 +4323,7 @@
     ArrayRef<uint8_t> Descriptor = Note.getDesc();
     Elf_Word Type = Note.getType();
 
-    OS << "  " << Name << std::string(22 - Name.size(), ' ')
+    OS << "  " << left_justify(Name, 20) << ' '
        << format_hex(Descriptor.size(), 10) << '\t';
 
     if (Name == "GNU") {
Index: llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
===================================================================
--- llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
+++ llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
@@ -1,23 +1,23 @@
 ## Test tools are able to dump different types of notes.
 
 # RUN: yaml2obj --docnum=1 %s > %t1.so
-# RUN: llvm-readelf --notes %t1.so | FileCheck %s --check-prefix=GNU
+# RUN: llvm-readelf --notes %t1.so | FileCheck %s --check-prefix=GNU --strict-whitespace --match-full-lines
 # RUN: llvm-readobj --notes %t1.so | FileCheck %s --check-prefix=LLVM
 
-# GNU:      Displaying notes found at file offset 0x00000200 with length 0x00000020:
-# GNU-NEXT:   Owner                 Data size       Description
-# GNU-NEXT:   GNU                   0x00000010      NT_GNU_ABI_TAG (ABI version tag)
-# GNU-NEXT:     OS: Linux, ABI: 2.6.32
-
-# GNU:      Displaying notes found at file offset 0x00000220 with length 0x00000020:
-# GNU-NEXT:   Owner                 Data size       Description
-# GNU-NEXT:   GNU                  0x00000010       NT_GNU_BUILD_ID (unique build ID bitstring)
-# GNU-NEXT:     Build ID: 4fcb712aa6387724a9f465a32cd8c14b
-
-# GNU:      Displaying notes found at file offset 0x00000240 with length 0x0000001c:
-# GNU-NEXT:   Owner                 Data size       Description
-# GNU-NEXT:   GNU                  0x00000009       NT_GNU_GOLD_VERSION (gold version)
-# GNU-NEXT:     Version: gold 1.11
+#      GNU:Displaying notes found at file offset 0x00000200 with length 0x00000020:
+# GNU-NEXT:  Owner                Data size 	Description
+# GNU-NEXT:  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
+# GNU-NEXT:    OS: Linux, ABI: 2.6.32
+
+#      GNU:Displaying notes found at file offset 0x00000220 with length 0x00000020:
+# GNU-NEXT:  Owner                Data size 	Description
+# GNU-NEXT:  GNU                  0x00000010	NT_GNU_BUILD_ID (unique build ID bitstring)
+# GNU-NEXT:    Build ID: 4fcb712aa6387724a9f465a32cd8c14b
+
+#      GNU:Displaying notes found at file offset 0x00000240 with length 0x0000001c:
+# GNU-NEXT:  Owner                Data size 	Description
+# GNU-NEXT:  GNU                  0x00000009	NT_GNU_GOLD_VERSION (gold version)
+# GNU-NEXT:    Version: gold 1.11
 
 # LLVM:      Notes [
 # LLVM-NEXT:   NoteSection {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65847.213821.patch
Type: text/x-patch
Size: 3262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190807/09892c9a/attachment.bin>


More information about the llvm-commits mailing list