1## This test checks -d disassembles an ELF file without section headers. 2## Such files include kcore files extracted by linux perf tools, or 3## executables with section headers stripped by e.g. 4## llvm-strip --strip-sections. 5 6# RUN: yaml2obj %s -o %t 7# RUN: llvm-objdump -d %t | FileCheck %s 8 9# CHECK: Disassembly of section PT_LOAD#0: 10# CHECK-EMPTY: 11# CHECK-NEXT: <PT_LOAD#0>: 12# CHECK-NEXT: 55 pushq %rbp 13# CHECK-NEXT: 48 89 e5 movq %rsp, %rbp 14# CHECK-NEXT: 0f 1f 40 00 nopl (%rax) 15# CHECK-NEXT: 5d popq %rbp 16# CHECK-NEXT: c3 retq 17 18## Check disassembly with an address range. 19# RUN: llvm-objdump -d --start-address=0xffffffff00000000 \ 20# RUN: --stop-address=0xffffffff00000004 %t 2>&1 | \ 21# RUN: FileCheck %s --check-prefix RANGE 22 23# RANGE: no section overlaps the range 24# RANGE-EMPTY: 25# RANGE-NEXT: Disassembly of section PT_LOAD#0: 26# RANGE-EMPTY: 27# RANGE-NEXT: <PT_LOAD#0>: 28# RANGE-NEXT: 55 pushq %rbp 29# RANGE-NEXT: 48 89 e5 movq %rsp, %rbp 30# RANGE-EMPTY: 31 32!ELF 33FileHeader: 34 Class: ELFCLASS64 35 Data: ELFDATA2LSB 36 Type: ET_CORE 37 Machine: EM_X86_64 38Sections: 39 - Type: SectionHeaderTable 40 NoHeaders: true 41 - Type: Fill 42 Name: code 43 Pattern: "554889E50F1F40005DC3" 44 Size: 10 45 Offset: 0x1000 46ProgramHeaders: 47 - Type: PT_LOAD 48 Flags: [ PF_X ] 49 VAddr: 0xFFFFFFFF00000000 50 FirstSec: code 51 LastSec: code 52