1 ## Check how obj2yaml dumps the sh_entsize field.
3 ## Check we don't dump the "EntSize" key for SHT_SYMTAB/SHT_DYNSYM sections
4 ## when the value of sh_entsize is equal to sizeof(ELF_Sym) == 0x18.
6 # RUN: yaml2obj %s -o %t
7 # RUN: obj2yaml %t | FileCheck %s
9 # CHECK: - Name: .rodata.cst4
10 # CHECK-NEXT: Type: SHT_PROGBITS
11 # CHECK-NEXT: EntSize: 0x4
12 # CHECK-NEXT: - Name: .mysymtab
13 # CHECK-NEXT: Type: SHT_SYMTAB
14 # CHECK-NEXT: Link: .strtab
15 # CHECK-NEXT: Size: 0x0
16 # CHECK-NEXT: - Name: .mydynsym
17 # CHECK-NEXT: Type: SHT_DYNSYM
18 # CHECK-NEXT: Size: 0x0
32 EntSize: [[SYMTABES=0x18]]
35 EntSize: [[DYNSYMES=0x18]]
37 ## Document that we are unable to dump a SHT_SYMTAB section when its entry size
38 ## is not equal to sizeof(ELF_Sym).
40 # RUN: yaml2obj %s -DSYMTABES=0x19 -o %t2
41 # RUN: not obj2yaml %t2 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=ERR1
43 # ERR1: Error reading file: [[FILE]]: section [index 2] has invalid sh_entsize: expected 24, but got 25
45 ## Document that we are unable to dump a SHT_DYNSYM section when its entry size
46 ## is not equal to sizeof(ELF_Sym).
48 # RUN: yaml2obj %s -DDYNSYMES=0x19 -o %t3
49 # RUN: not obj2yaml %t3 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=ERR2
51 # ERR2: Error reading file: [[FILE]]: section [index 3] has invalid sh_entsize: expected 24, but got 25