Skip to content

Commit

Permalink
[llvm-objdump] - Dump the archive headers when -all-headers is specif…
Browse files Browse the repository at this point in the history
…ied.

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.

Differential revision: https://reviews.llvm.org/D56780

llvm-svn: 351547
  • Loading branch information
George Rimar committed Jan 18, 2019
1 parent ef19af1 commit 5e36433
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions llvm/test/tools/llvm-objdump/all-headers.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-objdump/llvm-objdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2036,8 +2036,8 @@ int main(int argc, char **argv) {
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;
Expand Down

0 comments on commit 5e36433

Please sign in to comment.