155c81d42SFangrui Song# RUN: yaml2obj %s -o %t 2298ea3f5SJordan Rupprecht# RUN: llvm-objcopy --remove-section=.text.bar %t %t2 3*aa3df8ddSFangrui Song# RUN: llvm-readobj --section-groups %t2 | FileCheck %s 46e4dc6f2SAlexander Shaposhnikov 56e4dc6f2SAlexander Shaposhnikov# In this test the section .text.bar is getting removed, since this section 66e4dc6f2SAlexander Shaposhnikov# goes after all the sections comprising a group, the content of the 76e4dc6f2SAlexander Shaposhnikov# section .group doesn't change. 86e4dc6f2SAlexander Shaposhnikov 96e4dc6f2SAlexander Shaposhnikov# CHECK: Name: .group 106e4dc6f2SAlexander Shaposhnikov# CHECK-NEXT: Index: 1 116e4dc6f2SAlexander Shaposhnikov# CHECK-NEXT: Link: 3 126e4dc6f2SAlexander Shaposhnikov# CHECK-NEXT: Info: 2 136e4dc6f2SAlexander Shaposhnikov# CHECK-NEXT: Type: COMDAT (0x1) 146e4dc6f2SAlexander Shaposhnikov# CHECK-NEXT: Signature: foo 156e4dc6f2SAlexander Shaposhnikov# CHECK: .text.foo (2) 166e4dc6f2SAlexander Shaposhnikov 176e4dc6f2SAlexander Shaposhnikov--- !ELF 186e4dc6f2SAlexander ShaposhnikovFileHeader: 196e4dc6f2SAlexander Shaposhnikov Class: ELFCLASS64 206e4dc6f2SAlexander Shaposhnikov Data: ELFDATA2LSB 216e4dc6f2SAlexander Shaposhnikov Type: ET_REL 226e4dc6f2SAlexander Shaposhnikov Machine: EM_X86_64 236e4dc6f2SAlexander ShaposhnikovSections: 246e4dc6f2SAlexander Shaposhnikov - Name: .group 256e4dc6f2SAlexander Shaposhnikov Type: SHT_GROUP 266e4dc6f2SAlexander Shaposhnikov Link: .symtab 276e4dc6f2SAlexander Shaposhnikov AddressAlign: 0x0000000000000004 286e4dc6f2SAlexander Shaposhnikov Info: foo 296e4dc6f2SAlexander Shaposhnikov Members: 306e4dc6f2SAlexander Shaposhnikov - SectionOrType: GRP_COMDAT 316e4dc6f2SAlexander Shaposhnikov - SectionOrType: .text.foo 326e4dc6f2SAlexander Shaposhnikov - Name: .text.foo 336e4dc6f2SAlexander Shaposhnikov Type: SHT_PROGBITS 346e4dc6f2SAlexander Shaposhnikov Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ] 356e4dc6f2SAlexander Shaposhnikov AddressAlign: 0x0000000000000010 366e4dc6f2SAlexander Shaposhnikov - Name: .text.bar 376e4dc6f2SAlexander Shaposhnikov Type: SHT_PROGBITS 386e4dc6f2SAlexander Shaposhnikov Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 396e4dc6f2SAlexander Shaposhnikov AddressAlign: 0x0000000000000010 406e4dc6f2SAlexander ShaposhnikovSymbols: 416e4dc6f2SAlexander Shaposhnikov - Name: .text.foo 426e4dc6f2SAlexander Shaposhnikov Type: STT_SECTION 436e4dc6f2SAlexander Shaposhnikov Section: .text.foo 446e4dc6f2SAlexander Shaposhnikov - Name: .text.bar 456e4dc6f2SAlexander Shaposhnikov Type: STT_SECTION 466e4dc6f2SAlexander Shaposhnikov Section: .text.bar 476e4dc6f2SAlexander Shaposhnikov - Name: foo 486e4dc6f2SAlexander Shaposhnikov Type: STT_FUNC 496e4dc6f2SAlexander Shaposhnikov Section: .text.foo 506e4dc6f2SAlexander Shaposhnikov Size: 0x0000000000000000 516da44ad7SGeorge Rimar Binding: STB_WEAK 526e4dc6f2SAlexander Shaposhnikov - Name: bar 536e4dc6f2SAlexander Shaposhnikov Type: STT_FUNC 546e4dc6f2SAlexander Shaposhnikov Section: .text.bar 556e4dc6f2SAlexander Shaposhnikov Size: 0x0000000000000000 566da44ad7SGeorge Rimar Binding: STB_WEAK 57