1 ## Test reading ELF with .dynsym under the following conditions:
2 ## * Section headers are available.
3 ## * Section headers are stripped but there is a DT_GNU_HASH dynamic tag.
4 ## * Section headers are stripped but there is a DT_HASH dynamic tag.
6 ## Test if llvm-ifs reads DT_SYMTAB size through section headers by puting the wrong terminator in DT_GNU_HASH.
7 # RUN: yaml2obj %s -o %tfull -DGNUHASHVALUE="[0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00"
8 # RUN: llvm-ifs --input-format=ELF --output-ifs=- %tfull | FileCheck %s
10 ## Test if llvm-ifs fails to read DT_SYMTAB size through section headers when the value of sh_entsize is invalid.
11 # RUN: yaml2obj %s -o %tfull -DGNUHASHVALUE="[0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DENTSIZE="0x19"
12 # RUN: not llvm-ifs --input-format=ELF --output-ifs=- %tfull 2>&1 | FileCheck %s --check-prefix=BADENTSIZE
14 ## Test if llvm-ifs reads DT_SYMTAB size through DT_GNU_HASH.
15 # RUN: yaml2obj %s -o %tw.gnu.hash -DGNUHASHVALUE="[0x8, 0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DNOHEADER="true"
16 # RUN: llvm-ifs --input-format=ELF --output-ifs=- %tw.gnu.hash | FileCheck %s
18 ## Test if llvm-ifs fails to read DT_SYMTAB size through DT_GNU_HASH when there is no terminator.
19 # RUN: yaml2obj %s -o %tw.gnu.hash -DGNUHASHVALUE="[0x8, 0xA]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DNOHEADER="true"
20 # RUN: not llvm-ifs --input-format=ELF --output-ifs=- %tw.gnu.hash 2>&1 | FileCheck %s --check-prefix=NOTERMINATOR
23 # CHECK-NEXT: IfsVersion: 3.0
24 # CHECK-NEXT: Target: { ObjectFormat: ELF, Arch: AArch64, Endianness: little, BitWidth: 64 }
25 # CHECK-NEXT: Symbols:
26 # CHECK-NEXT: - { Name: bar, Type: Object, Size: 0, Undefined: true }
27 # CHECK-NEXT: - { Name: foo, Type: Func, Undefined: true }
30 # BADENTSIZE: SHT_DYNSYM section has sh_size (72) % sh_entsize (25) that is not 0
32 # NOTERMINATOR: error: no terminator found for GNU hash section before buffer end
52 EntSize: [[ENTSIZE=0x18]]
93 BloomFilter: [0x3, 0x4]
94 HashBuckets: [0x0, 0x1]
95 HashValues: [[GNUHASHVALUE]]
96 - Type: SectionHeaderTable
97 NoHeaders: [[NOHEADER=false]]