brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 8022d27 Raw
52 lines · plain
1## This test checks -d disassembles an ELF file without section headers.2## Such files include kcore files extracted by linux perf tools, or3## executables with section headers stripped by e.g.4## llvm-strip --strip-sections.5 6# RUN: yaml2obj %s -o %t7# RUN: llvm-objdump -d %t | FileCheck %s8 9# CHECK:       Disassembly of section PT_LOAD#0:10# CHECK-EMPTY:11# CHECK-NEXT:  <PT_LOAD#0>:12# CHECK-NEXT:  55                    pushq   %rbp13# CHECK-NEXT:  48 89 e5              movq    %rsp, %rbp14# CHECK-NEXT:  0f 1f 40 00           nopl    (%rax)15# CHECK-NEXT:  5d                    popq    %rbp16# CHECK-NEXT:  c3                    retq17 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 RANGE22 23# RANGE:       no section overlaps the range24# 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   %rbp29# RANGE-NEXT:  48 89 e5              movq    %rsp, %rbp30# RANGE-EMPTY:31 32!ELF33FileHeader:34  Class:           ELFCLASS6435  Data:            ELFDATA2LSB36  Type:            ET_CORE37  Machine:         EM_X86_6438Sections:39  - Type:            SectionHeaderTable40    NoHeaders:       true41  - Type:            Fill42    Name:            code43    Pattern:         "554889E50F1F40005DC3"44    Size:            1045    Offset:          0x100046ProgramHeaders:47  - Type:            PT_LOAD48    Flags:           [ PF_X ]49    VAddr:           0xFFFFFFFF0000000050    FirstSec:        code51    LastSec:         code52