2019-12-09 12:43:47 +01:00
|
|
|
# RUN: yaml2obj %s -o %t
|
2019-01-12 13:17:24 +01:00
|
|
|
# RUN: llvm-objdump --all-headers %t | FileCheck %s
|
2019-12-09 12:43:47 +01:00
|
|
|
# RUN: llvm-objdump -x %t | FileCheck %s
|
2019-01-12 13:17:24 +01:00
|
|
|
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
## Note: --all-headers (-x) is an alias for --archive-headers --file-headers
|
|
|
|
## --section-headers --private-headers --reloc --syms (-afhprt). Test for them
|
|
|
|
## in the following order which provides GNU objdump compatability.
|
2019-01-12 13:17:24 +01:00
|
|
|
|
[llvm-objdump] Print file format in lowercase to match GNU output.
Summary:
GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use.
As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779
Reviewers: MaskRay, jhenderson, alexshap
Reviewed By: MaskRay
Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74433
2020-02-11 20:55:40 +01:00
|
|
|
# CHECK: file format elf64-x86-64
|
2019-01-12 13:17:24 +01:00
|
|
|
# CHECK-NEXT: architecture: x86_64
|
|
|
|
# CHECK-NEXT: start address: 0x0000000000000000
|
|
|
|
# CHECK-EMPTY:
|
2021-05-04 18:56:06 +02:00
|
|
|
# CHECK-NEXT: Program Header:
|
|
|
|
# CHECK-EMPTY:
|
|
|
|
# CHECK-NEXT: Dynamic Section:
|
|
|
|
# CHECK: INIT
|
|
|
|
# CHECK-EMPTY:
|
|
|
|
# CHECK-NEXT: Sections:
|
|
|
|
# CHECK: 6 .shstrtab 0000002e 0000000000000000
|
|
|
|
# CHECK-EMPTY:
|
|
|
|
# CHECK-NEXT: SYMBOL TABLE:
|
|
|
|
# CHECK-NEXT: 0000000000000000 l .text 0000000000000000 foo
|
|
|
|
# CHECK-EMPTY:
|
|
|
|
# CHECK-NEXT: RELOCATION RECORDS FOR [.text]:
|
2019-01-12 13:17:24 +01:00
|
|
|
|
2019-01-18 13:01:59 +01:00
|
|
|
## 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
|
|
|
|
|
[llvm-objdump] Print file format in lowercase to match GNU output.
Summary:
GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use.
As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779
Reviewers: MaskRay, jhenderson, alexshap
Reviewed By: MaskRay
Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74433
2020-02-11 20:55:40 +01:00
|
|
|
# ARCHIVE: {{.*}}.a({{.*}}): file format elf64-x86-64
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
# ARCHIVE: rw-r--r--
|
2019-01-18 13:01:59 +01:00
|
|
|
# ARCHIVE: architecture: x86_64
|
|
|
|
# ARCHIVE: start address: 0x0000000000000000
|
|
|
|
# ARCHIVE: Program Header:
|
|
|
|
# ARCHIVE: Dynamic Section:
|
2019-09-13 10:56:28 +02:00
|
|
|
# ARCHIVE: Sections:
|
|
|
|
# ARCHIVE: SYMBOL TABLE:
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
# ARCHIVE: RELOCATION RECORDS FOR [.text]:
|
[llvm-objdump] Print file format in lowercase to match GNU output.
Summary:
GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use.
As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779
Reviewers: MaskRay, jhenderson, alexshap
Reviewed By: MaskRay
Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74433
2020-02-11 20:55:40 +01:00
|
|
|
# ARCHIVE: {{.*}}.a({{.*}}2): file format elf64-x86-64
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
# ARCHIVE: rw-r--r--
|
2019-01-18 13:01:59 +01:00
|
|
|
# ARCHIVE: architecture: x86_64
|
|
|
|
# ARCHIVE: start address: 0x0000000000000000
|
|
|
|
# ARCHIVE: Program Header:
|
|
|
|
# ARCHIVE: Dynamic Section:
|
2019-09-13 10:56:28 +02:00
|
|
|
# ARCHIVE: Sections:
|
|
|
|
# ARCHIVE: SYMBOL TABLE:
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
# ARCHIVE: RELOCATION RECORDS FOR [.text]:
|
2019-01-18 13:01:59 +01:00
|
|
|
|
2019-01-12 13:17:24 +01:00
|
|
|
!ELF
|
|
|
|
FileHeader:
|
|
|
|
Class: ELFCLASS64
|
|
|
|
Data: ELFDATA2LSB
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
Type: ET_REL
|
2019-01-12 13:17:24 +01:00
|
|
|
Machine: EM_X86_64
|
|
|
|
Sections:
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 00:01:08 +02:00
|
|
|
- Name: .text
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
- Name: .rel.text
|
|
|
|
Type: SHT_REL
|
|
|
|
Info: .text
|
|
|
|
Relocations:
|
|
|
|
- Offset: 0x1
|
|
|
|
Symbol: foo
|
|
|
|
Type: R_X86_64_32
|
|
|
|
- Name: .dynamic
|
|
|
|
Type: SHT_DYNAMIC
|
|
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
|
|
EntSize: 0x0000000000000010
|
|
|
|
Entries:
|
|
|
|
- Tag: DT_INIT
|
|
|
|
Value: 0x00000000000006A0
|
|
|
|
- Tag: DT_NULL
|
|
|
|
Value: 0x0000000000000000
|
|
|
|
Symbols:
|
|
|
|
- Name: foo
|
|
|
|
Section: .text
|