xref: /llvm-project/llvm/test/tools/llvm-objcopy/ELF/remove-section-group.test (revision a9313282cd5413ed498dceb763ebba12ea5bdecd)
1*a9313282SIgor Kudrin## This checks that when the header section of a group is removed, the tool
2*a9313282SIgor Kudrin## drops the flag SHF_GROUP for preserved members of that group.
3*a9313282SIgor Kudrin
4*a9313282SIgor Kudrin# RUN: yaml2obj %s -o - \
5*a9313282SIgor Kudrin# RUN:   | llvm-objcopy -R .group - - \
6*a9313282SIgor Kudrin# RUN:   | llvm-readobj --sections - \
7*a9313282SIgor Kudrin# RUN:   | FileCheck %s
8*a9313282SIgor Kudrin
9*a9313282SIgor Kudrin# CHECK:      Name: .foo
10*a9313282SIgor Kudrin# CHECK-NEXT: Type: SHT_PROGBITS
11*a9313282SIgor Kudrin# CHECK-NEXT: Flags [
12*a9313282SIgor Kudrin# CHECK-NEXT:   SHF_ALLOC
13*a9313282SIgor Kudrin# CHECK-NEXT: ]
14*a9313282SIgor Kudrin
15*a9313282SIgor Kudrin--- !ELF
16*a9313282SIgor KudrinFileHeader:
17*a9313282SIgor Kudrin  Class:      ELFCLASS64
18*a9313282SIgor Kudrin  Data:       ELFDATA2LSB
19*a9313282SIgor Kudrin  Type:       ET_REL
20*a9313282SIgor Kudrin  Machine:    EM_X86_64
21*a9313282SIgor KudrinSections:
22*a9313282SIgor Kudrin  - Name:     .group
23*a9313282SIgor Kudrin    Type:     SHT_GROUP
24*a9313282SIgor Kudrin    Info:     foo_grp
25*a9313282SIgor Kudrin    Members:
26*a9313282SIgor Kudrin      - SectionOrType:  GRP_COMDAT
27*a9313282SIgor Kudrin      - SectionOrType:  .foo
28*a9313282SIgor Kudrin  - Name:     .foo
29*a9313282SIgor Kudrin    Type:     SHT_PROGBITS
30*a9313282SIgor Kudrin    Flags:    [ SHF_ALLOC, SHF_GROUP ]
31*a9313282SIgor KudrinSymbols:
32*a9313282SIgor Kudrin  - Name:     foo_grp
33*a9313282SIgor Kudrin    Section:  .group
34