llvm.org GIT mirror llvm / e15998b
[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf. NFC The latter is much more common. A dedicated --elf-output-style=GNU test demonstrating it is the same as llvm-readelf is sufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359652 91177308-0d34-0410-b5e6-96231b3b80d8 Fangrui Song 11 months ago
14 changed file(s) with 40 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
0 # RUN: llvm-mc -triple x86_64-pc-linux-gnu %s -filetype=obj -o %t.o
1 # RUN: llvm-readobj -S --elf-output-style=GNU %t.o | FileCheck %s
1 # RUN: llvm-readelf -S %t.o | FileCheck %s
22
33 ## Check we add SHF_EXCLUDE flag for .dwo debug sections.
44 # CHECK: .debug_info.dwo {{.*}} E
1010 # RUN: --globalize-symbol Global1 \
1111 # RUN: --keep-global-symbol Global2 \
1212 # RUN: %t.o %t.2.o
13 # RUN: llvm-readobj --elf-output-style=GNU --symbols %t.2.o | FileCheck %s
13 # RUN: llvm-readelf --symbols %t.2.o | FileCheck %s
1414
1515 !ELF
1616 FileHeader:
3939 # RUN: -G Weak1 \
4040 # RUN: --globalize-symbol Weak2 \
4141 # RUN: %t.o %t.2.o
42 # RUN: llvm-readobj --elf-output-style=GNU --symbols %t.2.o | FileCheck %s
42 # RUN: llvm-readelf --symbols %t.2.o | FileCheck %s
4343
4444 # RUN: llvm-objcopy --regex --keep-global-symbols %t-globals-regexp.txt %t.o %t.3.o
45 # RUN: llvm-readobj --elf-output-style=GNU --symbols %t.3.o | FileCheck %s --check-prefix=REGEXP
45 # RUN: llvm-readelf --symbols %t.3.o | FileCheck %s --check-prefix=REGEXP
4646
4747 !ELF
4848 FileHeader:
0 # RUN: yaml2obj %s -o %t.o
11
2 # RUN: llvm-readobj --elf-section-groups --elf-output-style=GNU \
2 # RUN: llvm-readelf --elf-section-groups \
33 # RUN: %t.o >%tout.log 2>%terr.log
44 # RUN: FileCheck %s -check-prefix=GNU-STDERR < %terr.log
55 # GNU-STDERR: Error: section [ 3] in group section [ 4] already in group section [ 2]
1414
1515 RUN: llvm-readobj -g %p/Inputs/elf-groups.x86_64 \
1616 RUN: | FileCheck %s
17 RUN: llvm-readobj -g --elf-output-style=GNU %p/Inputs/elf-groups.x86_64 \
17 RUN: llvm-readelf -g %p/Inputs/elf-groups.x86_64 \
1818 RUN: | FileCheck --check-prefix="GNU" %s
1919 CHECK: Groups {
2020 CHECK-NEXT: Group {
None RUN: llvm-readobj --elf-hash-histogram %p/Inputs/gnuhash.so.elf-ppc64 \
1 RUN: --elf-output-style=GNU | FileCheck %s -check-prefix PPC64GNU
2 RUN: llvm-readobj --elf-hash-histogram %p/Inputs/gnuhash.so.elf-x86_64 --elf-output-style=GNU \
0 RUN: llvm-readelf --elf-hash-histogram %p/Inputs/gnuhash.so.elf-ppc64 \
1 RUN: | FileCheck %s -check-prefix PPC64GNU
2 RUN: llvm-readelf --elf-hash-histogram %p/Inputs/gnuhash.so.elf-x86_64 \
33 RUN: | FileCheck %s -check-prefix X86GNU
4 RUN: llvm-readobj --elf-hash-histogram %p/Inputs/got-plt.exe.elf-mipsel --elf-output-style=GNU \
4 RUN: llvm-readelf --elf-hash-histogram %p/Inputs/got-plt.exe.elf-mipsel \
55 RUN: | FileCheck %s -check-prefix SYSV
66
77 PPC64GNU: Histogram for `.gnu.hash' bucket list length (total of 3 buckets)
None RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 --elf-output-style=GNU \
0 RUN: llvm-readelf -h %p/Inputs/trivial.obj.elf-i386 \
11 RUN: | FileCheck %s -check-prefix ELF32
2 RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 --elf-output-style=GNU \
2 RUN: llvm-readelf -h %p/Inputs/trivial.obj.elf-x86-64 \
33 RUN: | FileCheck %s -check-prefix ELF64
4 RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-mipsel --elf-output-style=GNU \
4 RUN: llvm-readelf -h %p/Inputs/trivial.obj.elf-mipsel \
55 RUN: | FileCheck %s -check-prefix MIPSEL
66
77 ELF32: ELF Header:
99 # compiled as clang++ source.cpp
1010 # and clang++ -m32 source.cpp
1111
12 RUN: llvm-readobj -l %p/Inputs/phdrs-elf.exe-i386 --elf-output-style=GNU \
12 RUN: llvm-readelf -l %p/Inputs/phdrs-elf.exe-i386 \
1313 RUN: | FileCheck %s -check-prefix ELF32
14 RUN: llvm-readobj -l %p/Inputs/phdrs-elf.exe-x86_64 --elf-output-style=GNU \
14 RUN: llvm-readelf -l %p/Inputs/phdrs-elf.exe-x86_64 \
1515 RUN: | FileCheck %s -check-prefixes ELF64-PHDRS,ELF64-MAPPING
1616 RUN: llvm-readelf -program-headers %p/Inputs/phdrs-elf.exe-x86_64 \
1717 RUN: | FileCheck %s -check-prefixes ELF64-PHDRS,ELF64-MAPPING
None RUN: llvm-readobj -r %p/Inputs/relocs.obj.elf-i386 --elf-output-style=GNU \
0 RUN: llvm-readelf -r %p/Inputs/relocs.obj.elf-i386 \
11 RUN: | FileCheck %s -check-prefix ELF32
2 RUN: llvm-readobj -r %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
2 RUN: llvm-readelf -r %p/Inputs/relocs.obj.elf-x86_64 \
33 RUN: | FileCheck %s -check-prefix ELF64
44
55 ELF32: Relocation section '.rel.text' at offset 0x318 contains 41 entries:
None RUN: llvm-readobj -S %p/Inputs/relocs.obj.elf-i386 --elf-output-style=GNU \
0 RUN: llvm-readelf -S %p/Inputs/relocs.obj.elf-i386 \
11 RUN: | FileCheck %s -check-prefix ELF32
2 RUN: llvm-readobj -S %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
2 RUN: llvm-readelf -S %p/Inputs/relocs.obj.elf-x86_64 \
33 RUN: | FileCheck %s -check-prefix ELF64
44 RUN: llvm-readobj --wide --sections \
55 RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
None RUN: llvm-readobj --symbols %p/Inputs/symbols-proc-specific.elf-hexagon \
1 RUN: --elf-output-style=GNU | FileCheck %s --check-prefix ELF32
2 RUN: llvm-readobj --symbols %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
0 RUN: llvm-readelf --symbols %p/Inputs/symbols-proc-specific.elf-hexagon \
1 RUN: | FileCheck %s --check-prefix ELF32
2 RUN: llvm-readelf --symbols %p/Inputs/relocs.obj.elf-x86_64 \
33 RUN: | FileCheck %s --check-prefix ELF64
4 RUN: llvm-readobj --symbols %p/Inputs/gnuhash.so.elf-x86_64 --elf-output-style=GNU \
4 RUN: llvm-readelf --symbols %p/Inputs/gnuhash.so.elf-x86_64 \
55 RUN: | FileCheck %s --check-prefixes=SYMTAB,DYN
6 RUN: llvm-readobj --dyn-symbols %p/Inputs/gnuhash.so.elf-x86_64 --elf-output-style=GNU \
6 RUN: llvm-readelf --dyn-symbols %p/Inputs/gnuhash.so.elf-x86_64 \
77 RUN: | FileCheck %s --check-prefixes=NO-SYMTAB,DYN
8 RUN: llvm-readobj --symbols --dyn-symbols %p/Inputs/gnuhash.so.elf-x86_64 --elf-output-style=GNU \
8 RUN: llvm-readelf --symbols --dyn-symbols %p/Inputs/gnuhash.so.elf-x86_64 \
99 RUN: | FileCheck %s --check-prefixes=SYMTAB,DYN
1010
1111 ELF32: Symbol table '.symtab' contains 5 entries:
1010 ## space, but its e_shnum, e_shstrndx, sh_size and sh_link fields are set
1111 ## according to the above description, so that we can test the dumper.
1212
13 # RUN: llvm-readobj --file-headers -S --elf-output-style GNU \
14 # RUN: %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=GNU1
13 # RUN: llvm-readelf --file-headers -S %p/Inputs/many-sections.elf-x86_64 | \
14 # RUN: FileCheck %s --check-prefix=GNU1
1515 # GNU1: Number of section headers: 0 (5)
1616 # GNU1: Section header string table index: 65535 (3)
1717 # GNU1: There are 5 section headers, starting at offset 0xb8
1818
19 # RUN: llvm-readobj --file-headers --elf-output-style LLVM \
20 # RUN: %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=LLVM1
19 # RUN: llvm-readobj --file-headers %p/Inputs/many-sections.elf-x86_64 | \
20 # RUN: FileCheck %s --check-prefix=LLVM1
2121 # LLVM1: SectionHeaderCount: 0 (5)
2222 # LLVM1: StringTableSectionIndex: 65535 (3)
2323
2525 ## e_shoff field set to zero, but not e_shstrndx, to show that
2626 ## this corrupt case is handled correctly.
2727
28 # RUN: llvm-readobj --file-headers --elf-output-style GNU \
29 # RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=GNU2
28 # RUN: llvm-readelf --file-headers %p/Inputs/many-sections-stripped.elf-x86_64 | \
29 # RUN: FileCheck %s --check-prefix=GNU2
3030 # GNU2: Number of section headers: 0
3131 # GNU2: Section header string table index: 65535 (corrupt: out of range)
3232
33 # RUN: llvm-readobj --file-headers --elf-output-style LLVM \
34 # RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=LLVM2
33 # RUN: llvm-readobj --file-headers %p/Inputs/many-sections-stripped.elf-x86_64 | \
34 # RUN: FileCheck %s --check-prefix=LLVM2
3535 # LLVM2: SectionHeaderCount: 0
3636 # LLVM2: StringTableSectionIndex: 65535 (corrupt: out of range)
1010 RUN: llvm-readobj --mips-plt-got %p/Inputs/got-static.exe.mips | \
1111 RUN: FileCheck %s -check-prefix GOT-STATIC
1212
13 RUN: not llvm-readobj --mips-plt-got %p/Inputs/relocs.obj.elf-mips \
14 RUN: --elf-output-style=GNU 2>&1 | \
13 RUN: not llvm-readelf --mips-plt-got %p/Inputs/relocs.obj.elf-mips 2>&1 | \
1514 RUN: FileCheck %s -check-prefix GNU-GOT-OBJ
16 RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-exe.mips \
17 RUN: --elf-output-style=GNU | \
15 RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-exe.mips | \
1816 RUN: FileCheck %s -check-prefix GNU-GOT-EXE
19 RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-so.mips \
20 RUN: --elf-output-style=GNU | \
17 RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-so.mips | \
2118 RUN: FileCheck %s -check-prefix GNU-GOT-SO
22 RUN: llvm-readobj --mips-plt-got %p/Inputs/got-tls.so.elf-mips64el \
23 RUN: --elf-output-style=GNU | \
19 RUN: llvm-readelf --mips-plt-got %p/Inputs/got-tls.so.elf-mips64el | \
2420 RUN: FileCheck %s -check-prefix GNU-GOT-TLS
25 RUN: llvm-readobj --mips-plt-got %p/Inputs/got-empty.exe.mipsel \
26 RUN: --elf-output-style=GNU | \
21 RUN: llvm-readelf --mips-plt-got %p/Inputs/got-empty.exe.mipsel | \
2722 RUN: FileCheck %s -check-prefix GNU-GOT-EMPTY
28 RUN: llvm-readobj --mips-plt-got %p/Inputs/got-static.exe.mips \
29 RUN: --elf-output-style=GNU | \
23 RUN: llvm-readelf --mips-plt-got %p/Inputs/got-static.exe.mips | \
3024 RUN: FileCheck %s -check-prefix GNU-GOT-STATIC
3125
3226 GOT-OBJ: error: Cannot find .got section
0 RUN: llvm-readobj --mips-plt-got %p/Inputs/got-plt.exe.elf-mipsel | FileCheck %s
1 RUN: llvm-readobj --mips-plt-got --elf-output-style=GNU \
2 RUN: %p/Inputs/got-plt.exe.elf-mipsel \
3 RUN: | FileCheck --check-prefix=GNU %s
1 RUN: llvm-readelf --mips-plt-got %p/Inputs/got-plt.exe.elf-mipsel FileCheck --check-prefix=GNU %s
42
53 CHECK: PLT GOT {
64 CHECK-NEXT: Reserved entries [