1 ## Test that --section works correctly for -h.
2 ## We test the LMA here too, because the code at the time of writing uses the
3 ## value of --section when looking up section LMAs.
4 # RUN: yaml2obj %s --docnum=1 -o %t.h.elf
5 # RUN: llvm-objdump -h %t.h.elf -j.text --section=.bss \
6 # RUN: | FileCheck %s --check-prefix=SHDRS --implicit-check-not=.data --implicit-check-not=.text2
8 # SHDRS: Name Size VMA LMA
9 # SHDRS: .text 00000001 0000000000000400 0000000000001000
10 # SHDRS: .bss 00000001 0000000000000420 0000000000003000
21 Flags: [SHF_ALLOC, SHF_EXECINSTR]
27 Flags: [SHF_ALLOC, SHF_EXECINSTR]
32 Flags: [SHF_ALLOC, SHF_WRITE]
38 Flags: [SHF_ALLOC, SHF_WRITE]
59 ## Test that --section works with --fault-map-section.
60 # RUN: yaml2obj %s --docnum=2 -o %t.o
61 # RUN: llvm-objdump %t.o --fault-map-section -j __clangast \
62 # RUN: | FileCheck %s --check-prefixes=FAULTMAP,NO-FAULTMAP
63 # RUN: llvm-objdump %t.o --fault-map-section -j .llvm_faultmaps \
64 # RUN: | FileCheck %s --check-prefixes=FAULTMAP,WITH-FAULTMAP
66 # FAULTMAP: FaultMap table:
67 # NO-FAULTMAP-NEXT: <not found>
68 # WITH-FAULTMAP-NEXT: Version: 0x1
69 # WITH-FAULTMAP-NEXT: NumFunctions: 0
71 ## Test that --section works with --raw-clang-ast.
72 # RUN: llvm-objdump %t.o --raw-clang-ast -j .llvm_faultmaps \
73 # RUN: | FileCheck %s --check-prefix=NO-AST --allow-empty
74 # RUN: llvm-objdump %t.o --raw-clang-ast -j __clangast \
75 # RUN: | FileCheck %s --check-prefix=CLANG-AST
87 - Name: .llvm_faultmaps
89 Content: '0100000000000000'
92 Content: '666f6f626172' # "foobar"
94 ## Test that the -j alias can be used flexibly. Create a baseline and ensure
95 ## all other combinations compatible with POSIX are identical.
96 # RUN: llvm-objdump %t.h.elf -h -s --section .symtab > %t.full
97 # RUN: llvm-objdump %t.h.elf -h -s -j .symtab > %t.1
98 # RUN: llvm-objdump %t.h.elf -h -s -j.symtab > %t.2
99 # RUN: llvm-objdump %t.h.elf -hsj .symtab > %t.3
100 # RUN: llvm-objdump %t.h.elf -hsj.symtab > %t.4
102 # RUN: cmp %t.full %t.1
103 # RUN: cmp %t.full %t.2
104 # RUN: cmp %t.full %t.3
105 # RUN: cmp %t.full %t.4
107 ## Test that an unknown section name causes all section output to be suppressed.
108 # RUN: llvm-objdump %t.h.elf -h --section foobar \
109 # RUN: | FileCheck %s --check-prefix=NO-SECTION
111 # NO-SECTION: Sections:
112 # NO-SECTION-NEXT: Idx Name Size VMA Type
113 # NO-SECTION-NOT: {{.}}