56 lines · plain
1## Check bad DT_STRTAB address.2 3# RUN: yaml2obj %s -DSTRSZ_VALUE=0x0000000000000001 -DSTRTAB_ADDR=0x0000000000000260 -o %t4# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s -DERR_ADDR=0x2605 6 7## Check bad DT_STRSZ size.8 9# RUN: yaml2obj %s -DSTRSZ_VALUE=0x0000000000001000 -DSTRTAB_ADDR=0x0000000000001000 -o %t10# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s -DERR_ADDR=0x200011 12!ELF13FileHeader:14 Class: ELFCLASS6415 Data: ELFDATA2LSB16 Type: ET_DYN17 Machine: EM_X86_6418Sections:19 - Name: .dynstr20 Type: SHT_STRTAB21 Flags: [ SHF_ALLOC ]22 Address: 0x100023 Content: "00"24 - Name: .dynamic25 Type: SHT_DYNAMIC26 Flags: [ SHF_ALLOC ]27 Address: 0x000000000000100828 Link: .dynstr29 AddressAlign: 0x000000000000000830 EntSize: 0x000000000000001031 Entries:32 - Tag: DT_SONAME33 Value: 0x000000000000000034 - Tag: DT_STRSZ35 Value: [[STRSZ_VALUE]]36 - Tag: DT_STRTAB37 Value: [[STRTAB_ADDR]]38 - Tag: DT_SYMTAB39 Value: 0x000000000000100040 - Tag: DT_NULL41 Value: 0x000000000000000042ProgramHeaders:43 - Type: PT_LOAD44 Flags: [ PF_R ]45 VAddr: 0x100046 Align: 847 FirstSec: .dynstr48 LastSec: .dynamic49 - Type: PT_DYNAMIC50 Flags: [ PF_X, PF_R ]51 VAddr: 0x100852 FirstSec: .dynamic53 LastSec: .dynamic54 55# CHECK: virtual address is not in any segment: [[ERR_ADDR]] when locating dynamic string table section contents56