xref: /llvm-project/llvm/test/tools/llvm-objdump/X86/section-filter-disasm.test (revision b42196661ba7ccfa3d68906ed52e0488305291b2)
1# RUN: yaml2obj %s -o %t.o
2
3## By default, only executable sections are disassembled,
4## but with the use of the --section flag, we can change this behavior.
5## Show that llvm-objdump can disassemble the specified sections.
6
7# RUN: llvm-objdump -d %t.o | FileCheck %s --check-prefix=TEXT \
8# RUN:   --implicit-check-not=.rodata --implicit-check-not=.data
9
10# RUN: llvm-objdump -d %t.o --section=.rodata \
11# RUN:   | FileCheck %s --check-prefix=RODATA \
12# RUN:   --implicit-check-not=.text --implicit-check-not=.data
13
14# RUN: llvm-objdump -d %t.o --section=.rodata --section=.text \
15# RUN:   | FileCheck %s --check-prefixes=RODATA,TEXT \
16# RUN:   --implicit-check-not=.data
17
18# RUN: llvm-objdump -d %t.o --section=.rodata --section=.text --section=.data \
19# RUN:   | FileCheck %s --check-prefixes=RODATA,TEXT,DATA
20
21# RODATA: Disassembly of section .rodata
22# TEXT:   Disassembly of section .text
23# DATA:   Disassembly of section .data
24
25--- !ELF
26FileHeader:
27  Class:   ELFCLASS64
28  Data:    ELFDATA2LSB
29  Type:    ET_REL
30  Machine: EM_X86_64
31Sections:
32  - Name:    .rodata
33    Type:    SHT_PROGBITS
34    Flags:   [SHF_ALLOC]
35    Content: '00'
36  - Name:    .text
37    Type:    SHT_PROGBITS
38    Flags:   [SHF_ALLOC, SHF_EXECINSTR]
39    Content: '00'
40  - Name:    .data
41    Type:    SHT_PROGBITS
42    Flags:   [SHF_ALLOC, SHF_WRITE]
43    Content: '00'
44