1 ## Checks that the tool is able to read section groups from ELF.
3 ## Check how groups sections are dumped.
4 ## Check we don't dump the "EntSize" key when sh_entsize == 4.
6 # RUN: yaml2obj %s -o %t1.o
7 # RUN: obj2yaml %t1.o | FileCheck %s -DSEC=.rodata
9 # CHECK: - Name: .group
10 # CHECK-NEXT: Type: SHT_GROUP
11 # CHECK-NEXT: Link: .symtab
12 # CHECK-NEXT: Info: signature
13 # CHECK-NEXT: Members:
14 # CHECK-NEXT: - SectionOrType: GRP_COMDAT
15 # CHECK-NEXT: - SectionOrType: [[SEC]]
27 Info: [[INFO=signature]]
28 EntSize: [[ENTSIZE=<none>]]
30 - SectionOrType: GRP_COMDAT
31 - SectionOrType: [[SEC=.rodata]]
39 ## Document that yaml2obj can't dump the SHT_GROUP section when its sh_entsize != 4.
41 # RUN: yaml2obj %s -DENTSIZE=0xfe -o %t1.entsize.o
42 # RUN: not obj2yaml %t1.entsize.o 2>&1 | \
43 # RUN: FileCheck %s -DFILE=%t1.entsize.o --check-prefix=ENTSIZE
45 # ENTSIZE: Error reading file: [[FILE]]: section [index 1] has invalid sh_entsize: expected 4, but got 254
47 ## Check we are able to dump members of the SHT_GROUP section even when
48 ## one of them has section index 0.
50 # RUN: yaml2obj -DSEC=0 %s -o %tnull.o
51 # RUN: obj2yaml %tnull.o | FileCheck %s -DSEC="''"
53 ## Check obj2yaml report an error when sh_info field of
54 ## group section contains invalid (too large) signature symbol index.
56 # RUN: yaml2obj -DINFO=0xFF %s -o %t2.o
57 # RUN: not obj2yaml %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR
59 # ERR: Error reading file: [[FILE]]: unable to get symbol from section [index 3]: invalid symbol index (255)