1 ## Check how llvm-readobj prints sections with --sections.
2 ## We test the --sections flag for llvm-readelf in the gnu-sections.test.
4 # RUN: yaml2obj %s -o %t64
5 # RUN: llvm-readobj --sections %t64 | FileCheck %s --check-prefixes=ELF,ELF64
6 # RUN: yaml2obj -DBITS=32 %s -o %t32
7 # RUN: llvm-readobj --sections %t32 | FileCheck %s --check-prefixes=ELF,ELF32
9 ## Check flag aliases produce identical output.
10 # RUN: llvm-readobj --sections %t64 > %t64.llvm.sections
11 # RUN: llvm-readobj -S %t64 > %t64.llvm.upper.s
12 # RUN: cmp %t64.llvm.sections %t64.llvm.upper.s
13 # RUN: llvm-readobj --section-headers %t64 > %t64.llvm.section-headers
14 # RUN: cmp %t64.llvm.sections %t64.llvm.section-headers
16 # RUN: llvm-readobj --sections %t32 > %t32.llvm.sections
17 # RUN: llvm-readobj -S %t32 > %t32.llvm.upper.s
18 # RUN: cmp %t32.llvm.sections %t32.llvm.upper.s
19 # RUN: llvm-readobj --section-headers %t32 > %t32.llvm.section-headers
20 # RUN: cmp %t32.llvm.sections %t32.llvm.section-headers
26 # ELF-NEXT: Type: SHT_NULL (0x0)
27 # ELF-NEXT: Flags [ (0x0)
29 # ELF-NEXT: Address: 0x0
30 # ELF-NEXT: Offset: 0x0
34 # ELF-NEXT: AddressAlignment: 0
35 # ELF-NEXT: EntrySize: 0
39 # ELF-NEXT: Name: .foo (1)
40 # ELF-NEXT: Type: SHT_PROGBITS (0x1)
41 # ELF-NEXT: Flags [ (0x3)
42 # ELF-NEXT: SHF_ALLOC (0x2)
43 # ELF-NEXT: SHF_WRITE (0x1)
45 # ELF-NEXT: Address: 0x2
46 # ELF64-NEXT: Offset: 0x41
47 # ELF32-NEXT: Offset: 0x37
51 # ELF-NEXT: AddressAlignment: 5
52 # ELF-NEXT: EntrySize: 6
56 # ELF-NEXT: Name: .strtab (16)
57 # ELF-NEXT: Type: SHT_STRTAB (0x3)
58 # ELF-NEXT: Flags [ (0x0)
60 # ELF-NEXT: Address: 0x0
61 # ELF64-NEXT: Offset: 0x44
62 # ELF32-NEXT: Offset: 0x3A
66 # ELF-NEXT: AddressAlignment: 1
67 # ELF-NEXT: EntrySize: 0
71 # ELF-NEXT: Name: .shstrtab (6)
72 # ELF-NEXT: Type: SHT_STRTAB (0x3)
73 # ELF-NEXT: Flags [ (0x0)
75 # ELF-NEXT: Address: 0x0
76 # ELF64-NEXT: Offset: 0x45
77 # ELF32-NEXT: Offset: 0x3B
81 # ELF-NEXT: AddressAlignment: 1
82 # ELF-NEXT: EntrySize: 0
88 Class: ELFCLASS[[BITS=64]]
97 Flags: [ SHF_WRITE, SHF_ALLOC ]