1# REQUIRES: arm
2## For --gc-sections, group members are retained or discarded as a unit.
3## However, discarding a section via /DISCARD/ should not discard other members
4## within the group. This is compatible with GNU ld.
5
6# RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
7
8## We can discard .ARM.exidx* in a group.
9# RUN: echo 'SECTIONS { /DISCARD/ : { *(.ARM.exidx*) }}' > %t.noarm.script
10# RUN: ld.lld %t.o --gc-sections -T %t.noarm.script -o %t.noarm
11# RUN: llvm-readobj -S %t.noarm | FileCheck %s --check-prefix=NOARM --implicit-check-not='Name: .ARM.exidx'
12
13# NOARM: Name: .text
14# NOARM: Name: .note._start
15
16## Another example, we can discard SHT_NOTE in a group.
17# RUN: echo 'SECTIONS { /DISCARD/ : { *(.note*) }}' > %t.nonote.script
18# RUN: ld.lld %t.o --gc-sections -T %t.nonote.script -o %t.nonote
19# RUN: llvm-readobj -S %t.nonote | FileCheck %s --check-prefix=NONOTE --implicit-check-not='Name: .note'
20
21# NONOTE: Name: .ARM.exidx
22# NONOTE: Name: .text
23
24.section .text._start,"axG",%progbits,_start,comdat
25.globl _start
26_start:
27.fnstart
28.cantunwind
29bx lr
30.fnend
31
32.section .note._start,"G",%note,_start,comdat
33.byte 0
34