[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
Fri Jan 18 04:06:03 PST 2019


This revision was automatically updated to reflect the committed changes.
grimar marked 3 inline comments as done.
Closed by commit rL351547: [llvm-objdump] - Dump the archive headers when -all-headers is specified. (authored by grimar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56780?vs=182258&id=182493#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D56780

Files:
  llvm/trunk/test/tools/llvm-objdump/all-headers.test
  llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp


Index: llvm/trunk/test/tools/llvm-objdump/all-headers.test
===================================================================
--- llvm/trunk/test/tools/llvm-objdump/all-headers.test
+++ llvm/trunk/test/tools/llvm-objdump/all-headers.test
@@ -11,6 +11,31 @@
 # CHECK-EMPTY:
 # CHECK-NEXT:  Sections:
 
+## Check how we dump the archives.
+## Check we dump the appropriate headers for each file in the archive.
+
+# RUN: cp %t %t2
+# RUN: rm -f %t.a
+# RUN: llvm-ar rcs %t.a %t %t2
+# RUN: llvm-objdump --all-headers %t.a | FileCheck %s --check-prefix=ARCHIVE
+
+# ARCHIVE: {{.*}}.a({{.*}}):   file format ELF64-x86-64
+# ARCHIVE: architecture: x86_64
+# ARCHIVE: start address: 0x0000000000000000
+# ARCHIVE: rw-r--r--
+# ARCHIVE: Sections:
+# ARCHIVE: SYMBOL TABLE:
+# ARCHIVE: Program Header:
+# ARCHIVE: Dynamic Section:
+# ARCHIVE: {{.*}}.a({{.*}}2):   file format ELF64-x86-64
+# ARCHIVE: architecture: x86_64
+# ARCHIVE: start address: 0x0000000000000000
+# ARCHIVE: rw-r--r--
+# ARCHIVE: Sections:
+# ARCHIVE: SYMBOL TABLE:
+# ARCHIVE: Program Header:
+# ARCHIVE: Dynamic Section:
+
 !ELF
 FileHeader:
   Class:           ELFCLASS64
Index: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
@@ -2036,8 +2036,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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56780.182493.patch
Type: text/x-patch
Size: 1735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190118/4cfa5da0/attachment-0001.bin>


More information about the llvm-commits mailing list