File: section-group.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 (59 lines) | stat: -rw-r--r-- 1,842 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
52
53
54
55
56
57
58
59
## Checks that the tool is able to read section groups from ELF.

## Check how groups sections are dumped.
## Check we don't dump the "EntSize" key when sh_entsize == 4.

# RUN: yaml2obj %s -o %t1.o
# RUN: obj2yaml %t1.o | FileCheck %s -DSEC=.rodata

# CHECK:      - Name: .group
# CHECK-NEXT:   Type: SHT_GROUP
# CHECK-NEXT:   Link: .symtab
# CHECK-NEXT:   Info: signature
# CHECK-NEXT:   Members:
# CHECK-NEXT:     - SectionOrType: GRP_COMDAT
# CHECK-NEXT:     - SectionOrType: [[SEC]]
# CHECK-NEXT: - Name:

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Sections:
  - Name:    .group
    Type:    SHT_GROUP
    Link:    .symtab
    Info:    [[INFO=signature]]
    EntSize: [[ENTSIZE=<none>]]
    Members:
      - SectionOrType: GRP_COMDAT
      - SectionOrType: [[SEC=.rodata]]
  - Name: .rodata
    Type: SHT_PROGBITS
Symbols:
  - Name:    signature
    Type:    STT_OBJECT
    Section: .rodata

## Document that yaml2obj can't dump the SHT_GROUP section when its sh_entsize != 4.

# RUN: yaml2obj %s -DENTSIZE=0xfe -o %t1.entsize.o
# RUN: not obj2yaml %t1.entsize.o 2>&1 | \
# RUN:   FileCheck %s -DFILE=%t1.entsize.o --check-prefix=ENTSIZE

# ENTSIZE: Error reading file: [[FILE]]: section [index 1] has invalid sh_entsize: expected 4, but got 254

## Check we are able to dump members of the SHT_GROUP section even when
## one of them has section index 0.

# RUN: yaml2obj -DSEC=0 %s -o %tnull.o
# RUN: obj2yaml %tnull.o | FileCheck %s -DSEC="''"

## Check obj2yaml report an error when sh_info field of
## group section contains invalid (too large) signature symbol index.

# RUN: yaml2obj -DINFO=0xFF %s -o %t2.o
# RUN: not obj2yaml %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR

# ERR: Error reading file: [[FILE]]: unable to get symbol from section [index 3]: invalid symbol index (255)