brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 20a836c Raw
85 lines · plain
1## This checks that the group section is shrunk when its member is removed.2 3# RUN: yaml2obj --docnum=1 %s -o - \4# RUN:   | llvm-objcopy -R .foo - - \5# RUN:   | obj2yaml - \6# RUN:   | FileCheck %s7 8# CHECK:      - Name: .group9# CHECK:        Members:10# CHECK-NEXT:     - SectionOrType:  GRP_COMDAT11# CHECK-NEXT:     - SectionOrType:  .bar12# CHECK-NOT:      - SectionOrType:13 14--- !ELF15FileHeader:16  Class:      ELFCLASS6417  Data:       ELFDATA2LSB18  Type:       ET_REL19  Machine:    EM_X86_6420Sections:21  - Name:     .group22    Type:     SHT_GROUP23    Info:     foo_bar_grp24    Members:25      - SectionOrType:  GRP_COMDAT26      - SectionOrType:  .foo27      - SectionOrType:  .bar28  - Name:     .foo29    Type:     SHT_PROGBITS30    Flags:    [ SHF_ALLOC, SHF_GROUP ]31  - Name:     .bar32    Type:     SHT_PROGBITS33    Flags:    [ SHF_ALLOC, SHF_GROUP ]34Symbols:35  - Name:     foo_bar_grp36    Section:  .group37    Binding:  STB_GLOBAL38 39# RUN: yaml2obj --docnum=2 %s -o %t40# RUN: llvm-objcopy --remove-section=.debug_macro %t41# RUN: llvm-readelf --section-groups %t | FileCheck %s --check-prefix=GROUP-REMOVED42 43--- !ELF44FileHeader:45  Class:      ELFCLASS6446  Data:       ELFDATA2LSB47  Type:       ET_REL48  Machine:    EM_X86_6449Sections:50  - Name:     .group51    Type:     SHT_GROUP52    Info:     foo_grp53    Members:54      - SectionOrType:  GRP_COMDAT55      - SectionOrType:  .debug_macro56  - Name:     .debug_macro57    Type:     SHT_PROGBITS58    Flags:    [ SHF_GROUP ]59Symbols:60  - Name:     foo_grp61    Section:  .group62 63# GROUP-REMOVED: There are no section groups in this file.64 65# RUN: yaml2obj --docnum=3 %s -o %t66# RUN: llvm-objcopy --remove-section=.group %t67# RUN: llvm-readelf --section-groups %t | FileCheck %s --check-prefix=EMPTY-GROUP-REMOVED68 69--- !ELF70FileHeader:71  Class:      ELFCLASS6472  Data:       ELFDATA2LSB73  Type:       ET_REL74  Machine:    EM_X86_6475Sections:76  - Name:     .group77    Type:     SHT_GROUP78    Info:     foo_grp79    Members:80      - SectionOrType:  GRP_COMDAT81Symbols:82  - Name:     foo_grp83    Section:  .group84 85# EMPTY-GROUP-REMOVED: There are no section groups in this file.