brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · d3afda5 Raw
34 lines · plain
1## This test ensures llvm-objdump emits a helpful error message when dumping a symbol table2## whose sh_size isn't a multiple of the symbol size (sh_size % sizeof(Elf_Sym) != 0).3 4## a) Broken .symtab symbol table. Valid .dynsym symbol table.5# RUN: yaml2obj -DBITS=32 -DSIZE=33 -DDYNSIZE=32 %s -o %t.32-bit.o6# RUN: llvm-objdump --syms %t.32-bit.o 2>&1 | FileCheck -DSIZE=33 -DSYMSIZE=16 -DINDEX=2 %s7# RUN: yaml2obj -DBITS=64 -DSIZE=49 -DDYNSIZE=48 %s -o %t.64-bit.o8# RUN: llvm-objdump --syms %t.64-bit.o 2>&1 | FileCheck -DSIZE=49 -DSYMSIZE=24 -DINDEX=2 %s9 10## b) Broken .dynsym symbol table. Valid .symtab symbol table.11# RUN: yaml2obj -DBITS=32 -DSIZE=32 -DDYNSIZE=33 %s -o %t.32-bit.o12# RUN: llvm-objdump --dynamic-syms %t.32-bit.o 2>&1 | FileCheck -DSIZE=33 -DSYMSIZE=16 -DINDEX=3 %s13# RUN: yaml2obj -DBITS=64 -DSIZE=48 -DDYNSIZE=49 %s -o %t.64-bit.o14# RUN: llvm-objdump --dynamic-syms %t.64-bit.o 2>&1 | FileCheck -DSIZE=49 -DSYMSIZE=24 -DINDEX=3 %s15 16# CHECK: warning: {{.*}} section [index [[INDEX]]] has an invalid sh_size ([[SIZE]]) which is not a multiple of its sh_entsize ([[SYMSIZE]])17 18--- !ELF19FileHeader:20  Class:   ELFCLASS[[BITS]]21  Data:    ELFDATA2LSB22  Type:    ET_DYN23  Machine: EM_X86_6424Sections:25  - Name:    .dynstr26    Type:    SHT_STRTAB27    Content: "00"28  - Name:    .symtab29    Type:    SHT_SYMTAB30    Size:    [[SIZE]]31  - Name:    .dynsym32    Type:    SHT_DYNSYM33    Size:    [[DYNSIZE]]34