38 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple arm-gnu-linux-eabi -mcpu cortex-a7 -arm-add-build-attributes %s -o %t.o3// RUN: echo "SECTIONS { . = 0x10000; .text : { *(.text) } /DISCARD/ : { *(.exit.text) } }" > %t.script4// RUN: ld.lld -T %t.script %t.o -o %t.elf5// RUN: llvm-readobj -x .ARM.exidx --sections %t.elf | FileCheck %s6 7// CHECK-NOT: .exit.text8/// Expect 2 entries both CANTUNWIND as the .ARM.exidx.exit.text9// should have been removed.10// CHECK: Hex dump of section '.ARM.exidx':11// CHECK-NEXT: 0x00010000 10000000 01000000 10000000 0100000012 13/// The /DISCARD/ is evaluated after sections have been assigned to the14/// .ARM.exidx synthetic section. We must account for the /DISCARD/15 .section .exit.text, "ax", %progbits16 .globl foo17 .type foo, %function18foo:19 .fnstart20 bx lr21 .save {r7, lr}22 .setfp r7, sp, #023 .fnend24 25 .text26 .globl _start27 .type _start, %function28_start:29 .fnstart30 bx lr31 .cantunwind32 .fnend33 34 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits35 .global __aeabi_unwind_cpp_pr036__aeabi_unwind_cpp_pr0:37 bx lr38