34 lines · plain
1# REQUIRES: arm2## For --gc-sections, group members are retained or discarded as a unit.3## However, discarding a section via /DISCARD/ should not discard other members4## within the group. This is compatible with GNU ld.5 6# RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o7 8## We can discard .ARM.exidx* in a group.9# RUN: echo 'SECTIONS { /DISCARD/ : { *(.ARM.exidx*) }}' > %t.noarm.script10# RUN: ld.lld %t.o --gc-sections -T %t.noarm.script -o %t.noarm11# RUN: llvm-readobj -S %t.noarm | FileCheck %s --check-prefix=NOARM --implicit-check-not='Name: .ARM.exidx'12 13# NOARM: Name: .text14# NOARM: Name: .note._start15 16## Another example, we can discard SHT_NOTE in a group.17# RUN: echo 'SECTIONS { /DISCARD/ : { *(.note*) }}' > %t.nonote.script18# RUN: ld.lld %t.o --gc-sections -T %t.nonote.script -o %t.nonote19# RUN: llvm-readobj -S %t.nonote | FileCheck %s --check-prefix=NONOTE --implicit-check-not='Name: .note'20 21# NONOTE: Name: .ARM.exidx22# NONOTE: Name: .text23 24.section .text._start,"axG",%progbits,_start,comdat25.globl _start26_start:27.fnstart28.cantunwind29bx lr30.fnend31 32.section .note._start,"G",%note,_start,comdat33.byte 034