1// REQUIRES: arm
2// RUN: llvm-mc -filetype=obj -triple arm-gnu-linux-eabi -mcpu cortex-a7 -arm-add-build-attributes %s -o %t.o
3// RUN: echo "SECTIONS { . = 0x10000; .text : { *(.text) } /DISCARD/ : { *(.exit.text) } }" > %t.script
4// RUN: ld.lld -T %t.script %t.o -o %t.elf
5// RUN: llvm-readobj -x .ARM.exidx --sections %t.elf | FileCheck %s
6
7// CHECK-NOT: .exit.text
8/// Expect 2 entries both CANTUNWIND as the .ARM.exidx.exit.text
9// should have been removed.
10// CHECK: Hex dump of section '.ARM.exidx':
11// CHECK-NEXT: 0x00010000 10000000 01000000 10000000 01000000
12
13/// The /DISCARD/ is evaluated after sections have been assigned to the
14/// .ARM.exidx synthetic section. We must account for the /DISCARD/
15 .section .exit.text, "ax", %progbits
16 .globl foo
17 .type foo, %function
18foo:
19 .fnstart
20 bx lr
21 .save {r7, lr}
22 .setfp r7, sp, #0
23 .fnend
24
25 .text
26 .globl _start
27 .type _start, %function
28_start:
29 .fnstart
30 bx lr
31 .cantunwind
32 .fnend
33
34 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits
35 .global __aeabi_unwind_cpp_pr0
36__aeabi_unwind_cpp_pr0:
37 bx lr
38