[ELF] Make section member orders consistent
[llvm-project.git] / lld / test / ELF / sht-group-empty.test
blobbe51fcadee8f8a9ff702540abc9ec675191019c6
1 # RUN: yaml2obj %s -o %t.o
2 # RUN: ld.lld %t.o %t.o -o %t -r
3 # RUN: llvm-readobj -S %t | FileCheck %s
5 # CHECK:     Name: .text.foo
6 # CHECK:     Name: .rela.text.foo
8 --- !ELF
9 FileHeader:
10   Class:           ELFCLASS64
11   Data:            ELFDATA2LSB
12   Type:            ET_REL
13   Machine:         EM_X86_64
14 Sections:
15   - Name:            .group
16     Type:            SHT_GROUP
17     Link:            .symtab
18     Info:            foo
19     Members:
20       - SectionOrType:    GRP_COMDAT
21       - SectionOrType:    .text.foo
22       - SectionOrType:    .text.bar
23       - SectionOrType:    .note
24   - Name:            .note
25     Type:            SHT_NOTE
26     Flags:           [ SHF_GROUP ]
27     Content:         ""
28   - Name:            .text.foo
29     Type:            SHT_PROGBITS
30     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
31   - Name:            .text.bar
32     Type:            SHT_PROGBITS
33     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
34   - Name:            .rela.text.foo
35     Type:            SHT_RELA
36     Flags:           [ SHF_INFO_LINK, SHF_GROUP ]
37     Link:            .symtab
38     Info:            .text.foo
39     Relocations:
40       - Symbol:          foo
41         Type:            R_X86_64_64
42   - Name:            .rela.text.bar
43     Type:            SHT_RELA
44     Flags:           [ SHF_INFO_LINK, SHF_GROUP ]
45     Link:            .symtab
46     Info:            .text.bar
47     Relocations:
48       - Symbol:          bar
49         Type:            R_X86_64_64
50 Symbols:
51   - Name:            foo
52     Binding:         STB_GLOBAL
53   - Name:            bar
54     Binding:         STB_GLOBAL