File: entsize.yaml

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (51 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## Check how obj2yaml dumps the sh_entsize field.

## Check we don't dump the "EntSize" key for SHT_SYMTAB/SHT_DYNSYM sections
## when the value of sh_entsize is equal to sizeof(ELF_Sym) == 0x18.

# RUN: yaml2obj %s -o %t
# RUN: obj2yaml %t | FileCheck %s

# CHECK:       - Name:    .rodata.cst4
# CHECK-NEXT:    Type:    SHT_PROGBITS
# CHECK-NEXT:    EntSize: 0x4
# CHECK-NEXT:  - Name: .mysymtab
# CHECK-NEXT:    Type: SHT_SYMTAB
# CHECK-NEXT:    Link: .strtab
# CHECK-NEXT:    Size: 0x0
# CHECK-NEXT:  - Name: .mydynsym
# CHECK-NEXT:    Type: SHT_DYNSYM
# CHECK-NEXT:    Size: 0x0
# CHECK-NEXT: ...

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Sections:
  - Name:    .rodata.cst4
    Type:    SHT_PROGBITS
    EntSize: 0x4
  - Name:    .mysymtab
    Type:    SHT_SYMTAB
    EntSize: [[SYMTABES=0x18]]
  - Name:    .mydynsym
    Type:    SHT_DYNSYM
    EntSize: [[DYNSYMES=0x18]]

## Document that we are unable to dump a SHT_SYMTAB section when its entry size
## is not equal to sizeof(ELF_Sym).

# RUN: yaml2obj %s -DSYMTABES=0x19 -o %t2
# RUN: not obj2yaml %t2 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=ERR1

# ERR1: Error reading file: [[FILE]]: section [index 2] has invalid sh_entsize: expected 24, but got 25

## Document that we are unable to dump a SHT_DYNSYM section when its entry size
## is not equal to sizeof(ELF_Sym).

# RUN: yaml2obj %s -DDYNSYMES=0x19 -o %t3
# RUN: not obj2yaml %t3 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=ERR2

# ERR2: Error reading file: [[FILE]]: section [index 3] has invalid sh_entsize: expected 24, but got 25