2 // RUN
: llvm-mc
--arm-add-build-attributes
--triple
=armv7a-linux-gnueabihf
-filetype
=obj
%s
-o
%t.o
3 // RUN
: echo
"SECTIONS { \
4 // RUN: /DISCARD/ : { *(.ARM.exidx.exit.text) *(.ARM.extab.exit.text)} \
5 // RUN: . = 0x90000000; \
6 // RUN: .ARM.exidx : { *(.ARM.exidx) } \
7 // RUN: .text : { *(.text) } \
8 // RUN: .exit.text : { *(.exit.text) } \
9 // RUN: .rodata : { *(.rodata) } \
10 // RUN: } " > %t.script
11 // RUN
: ld.lld
--script
%t.script
%t.o
-o
%t
12 // RUN
: llvm-readelf
-x
.ARM.exidx %t | FileCheck %s
14 /// The linker script
/DISCARDS
/ the
.ARM.exidx and .ARM.extab for the
15 /// .exit.text . If we do not discard both sections we will end up with
16 /// a dangling reference. We expect no linker error for an out of range
17 /// relocation
/dangling reference
and just
a single
.ARM.exidx entry
18 /// for _start
and an entry for the terminating sentinel.
20 // CHECK
: Hex dump of section
'.ARM.exidx':
21 // CHECK-NEXT
: 0x90000000 10000000 01000000 10000000 01000000
22 // CHECK-
NOT: 0x90000010
25 .type _start, %function
32 .section .exit.text, "ax", %progbits
34 .type exit_text, %function
38 .personality __gxx_personality_v0
43 /// Dummy definition for
a reference from the personality routine created by
44 /// the assembler
, use
.data to avoid generating a cantunwind table.
46 .global __aeabi_unwind_cpp_pr0
47 __aeabi_unwind_cpp_pr0
: