[PATCH] D56780: [llvm-objdump] - Dump the archive headers when -all-headers is specified

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 05:49:41 PST 2019


grimar created this revision.
grimar added a reviewer: jhenderson.
Herald added a subscriber: rupprecht.

When `-all-headers` is given it is supposed to dump all headers,
but now it skips the archive headers for no reason.

The patch fixes that.


https://reviews.llvm.org/D56780

Files:
  test/tools/llvm-objdump/archive-headers.test
  tools/llvm-objdump/llvm-objdump.cpp


Index: tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- tools/llvm-objdump/llvm-objdump.cpp
+++ tools/llvm-objdump/llvm-objdump.cpp
@@ -2481,8 +2481,8 @@
     InputFilenames.push_back("a.out");
 
   if (AllHeaders)
-    FileHeaders = PrivateHeaders = Relocations = SectionHeaders = SymbolTable =
-        true;
+    ArchiveHeaders = FileHeaders = PrivateHeaders = Relocations =
+        SectionHeaders = SymbolTable = true;
 
   if (DisassembleAll || PrintSource || PrintLines)
     Disassemble = true;
Index: test/tools/llvm-objdump/archive-headers.test
===================================================================
--- test/tools/llvm-objdump/archive-headers.test
+++ test/tools/llvm-objdump/archive-headers.test
@@ -1,6 +1,9 @@
 # RUN: llvm-objdump -a %p/Inputs/liblong_filenames.a | FileCheck %s
 # RUN: llvm-objdump -archive-headers %p/Inputs/liblong_filenames.a | FileCheck %s
 
+## Check that we dump the archive headers when -all-headers is specified.
+# RUN: llvm-objdump -all-headers %p/Inputs/liblong_filenames.a | FileCheck %s
+
 # CHECK: {{.*}}liblong_filenames.a(1.o): file format ELF64-x86-64
 # CHECK: rw-r--r-- 204299/200  1416 {{.*}} 1.o
 # CHECK: {{.*}}liblong_filenames.a(2.o): file format ELF64-x86-64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56780.182021.patch
Type: text/x-patch
Size: 1288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/66fe3042/attachment.bin>


More information about the llvm-commits mailing list