47 lines · plain
1## Show how --start-address and --stop-address work in a relocatable object.2## They limit the disassembly to the relative offset ranges within sections.3# RUN: yaml2obj %s -o %t.o4# RUN: llvm-objdump -d %t.o --start-address=1 --stop-address=2 | FileCheck %s --check-prefix=COMMON5# RUN: llvm-objdump -d %t.o --start-address=1 | FileCheck %s --check-prefixes=START,COMMON6# RUN: llvm-objdump -d %t.o --stop-address=2 | FileCheck %s --check-prefixes=STOP,COMMON7 8# COMMON: Disassembly of section .text:9# COMMON-EMPTY:10# COMMON-NEXT: 0000000000000000 <.text>:11# STOP-NEXT: 0: 90 nop12# COMMON-NEXT: 1: 90 nop13# START-NEXT: 2: 90 nop14# COMMON-EMPTY:15# COMMON-NEXT: Disassembly of section .text2:16# COMMON-EMPTY:17# COMMON-NEXT: 0000000000000000 <.text2>:18# STOP-NEXT: 0: c3 retq19# COMMON-NEXT: 1: c3 retq20# START-NEXT: 2: c3 retq21# STOP-EMPTY:22# STOP-NEXT: Disassembly of section .text3:23# STOP-EMPTY:24# STOP-NEXT: 0000000000000000 <.text3>:25# STOP-NEXT: 0: cc int326# COMMON-NOT: {{.}}27 28--- !ELF29FileHeader:30 Class: ELFCLASS6431 Data: ELFDATA2LSB32 Type: ET_REL33 Machine: EM_X86_6434Sections:35 - Name: .text36 Type: SHT_PROGBITS37 Flags: [SHF_ALLOC, SHF_EXECINSTR]38 Content: '909090'39 - Name: .text240 Type: SHT_PROGBITS41 Flags: [SHF_ALLOC, SHF_EXECINSTR]42 Content: 'c3c3c3'43 - Name: .text344 Type: SHT_PROGBITS45 Flags: [SHF_ALLOC, SHF_EXECINSTR]46 Content: 'cc'47