1 ## Test that --section works correctly for -d with -r.
2 # RUN: yaml2obj %s -o %t.o
4 ## Show that only the specified sections are disassembled.
5 ## Also show that no relocation sections are dumped because none are
7 # RUN: llvm-objdump -d -r %t.o --section=.text --section=.rodata \
8 # RUN: | FileCheck %s --check-prefixes=DISASM,RELOC --implicit-check-not=.text2
10 # DISASM: Disassembly of section .text:
12 # DISASM-NEXT: 0000000000000400 .text:
13 # DISASM-NEXT: 400: e8 00 00 00 00 callq 0 <.text+0x5>
14 # RELOC-NEXT: 00000401: R_X86_64_PC32 foo+1
15 # RELOC-NEXT: 00000401: R_X86_64_GOT32 foo
16 # DISASM: Disassembly of section .rodata:
18 # DISASM-NEXT: 0000000000000000 .rodata:
19 # DISASM-NEXT: 0: 00 00 addb %al, (%rax)
20 # RELOC-NEXT: 0000000000000000: R_X86_64_NONE foo
21 # DISASM-NEXT: 2: 00 00 addb %al, (%rax)
32 Flags: [SHF_ALLOC, SHF_EXECINSTR]
38 Flags: [SHF_ALLOC, SHF_EXECINSTR]
40 Content: '90e800000000'
49 - Name: .another.rela.text
78 ## Test that --section works when dumping relocation sections.
79 # RUN: llvm-objdump -r %t.o --section=.another.rela.text --section=.rela.rodata \
80 # RUN: | FileCheck %s --check-prefix=DUMP-RELOCS --implicit-check-not=R_X86_64 \
81 # RUN: --implicit-check-not="RELOCATION RECORDS"
83 # DUMP-RELOCS: RELOCATION RECORDS FOR [.text]:
84 # DUMP-RELOCS: 00000001 R_X86_64_GOT32 foo
85 # DUMP-RELOCS: RELOCATION RECORDS FOR [.rodata]:
86 # DUMP-RELOCS: 00000000 R_X86_64_NONE foo
88 ## Test that --section works with --full-contents.
89 # RUN: llvm-objdump -s %t.o --section=.text --section=.rela.text2 \
90 # RUN: | FileCheck %s --check-prefix=CONTENTS \
91 # RUN: --implicit-check-not=.text \
92 # RUN: --implicit-check-not=.rodata
94 # CONTENTS: Contents of section .text:
95 # CONTENTS: Contents of section .rela.text2: