2 // RUN
: llvm-mc
-filetype
=obj
--arm-add-build-attributes
-triple
=armv7a-none-linux-gnueabi
%s
-o
%t
3 // RUN
: ld.lld
%t -o
%t2
4 // RUN
: llvm-objdump
-d
--triple
=armv7a-none-linux-gnueabi
--no-show-raw-insn
%t2 | FileCheck
%s
5 // RUN
: llvm-objdump
-s
--triple
=armv7a-none-linux-gnueabi
%t2 | FileCheck
--check-prefix
=CHECK-EXIDX
%s
6 // RUN
: llvm-readobj
--program-headers
--sections
%t2 | FileCheck
-check-prefix
=CHECK-PT
%s
8 // Test that inline unwinding table entries
and references to
.ARM.extab
9 // entries survive the re-ordering of the
.ARM.exidx section
12 // Will produce an ARM.exidx entry with inline unwinding instructions
13 .section .text.func1, "ax",%progbits
22 // Unwinding instructions for
.text2 too large for an inline entry ARM.exidx
23 // entry.
A separate
.ARM.extab section is created to hold the unwind entries
24 // The
.ARM.exidx table entry has a reference to the .ARM.extab section.
25 .section .text.func2, "ax",%progbits
30 .personality __gxx_personality_v0
36 // Dummy implementation of personality routines to satisfy reference from
38 .section .text.__gcc_personality_v0, "ax", %progbits
39 .global __gxx_personality_v0
43 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits
44 .global __aeabi_unwind_cpp_pr0
45 __aeabi_unwind_cpp_pr0
:
55 // CHECK
: Disassembly of section
.text:
57 // CHECK-NEXT
: <_start
>:
58 // CHECK-NEXT
: 20108: bl 0x20114 <func1
>
59 // CHECK-NEXT
: bl 0x20118 <func2
>
62 // CHECK-NEXT
: 20114: bx
lr
64 // CHECK-NEXT
: 20118: bx
lr
65 // CHECK
: <__gxx_personality_v0
>:
66 // CHECK-NEXT
: 2011c
: bx
lr
67 // CHECK
: <__aeabi_unwind_cpp_pr0
>:
68 // CHECK-NEXT
: 20120: bx
lr
70 /// 100d4
+ 0x10034 = 0x20108 = main
(linker generated cantunwind
)
71 /// 100dc
+ 0x10038 = 0x20114 = func1
(inline unwinding data
)
72 // CHECK-EXIDX
: 100d4
34000100 01000000 38000100 08849780
73 /// 100e4
+ 0x10034 = 0x20118 = func2
(100e8
+ 14 = 100fc
= .ARM.extab entry)
74 /// 100ec
+ 0x10030 = 0x2011c = __gxx_personality_v0
(linker generated cantunwind
)
75 // CHECK-EXIDX-NEXT
: 100e4
34000100 14000000 30000100 01000000
76 /// 100f4 + 0x10030 = 1101c
= sentinel
77 // CHECK-EXIDX-NEXT
: 100f4 30000100 01000000
79 // CHECK-PT
: Name
: .ARM.exidx
80 // CHECK-PT-NEXT
: Type
: SHT_ARM_EXIDX
(0x70000001)
81 // CHECK-PT-NEXT
: Flags
[
82 // CHECK-PT-NEXT
: SHF_ALLOC
83 // CHECK-PT-NEXT
: SHF_LINK_ORDER
85 // CHECK-PT-NEXT
: Address
: 0x100D4
86 // CHECK-PT-NEXT
: Offset
: 0xD4
87 // CHECK-PT-NEXT
: Size
: 40
89 // CHECK-PT
: Type
: PT_ARM_EXIDX
(0x70000001)
90 // CHECK-PT-NEXT
: Offset
: 0xD4
91 // CHECK-PT-NEXT
: VirtualAddress
: 0x100D4
92 // CHECK-PT-NEXT
: PhysicalAddress
: 0x100D4
93 // CHECK-PT-NEXT
: FileSize
: 40
94 // CHECK-PT-NEXT
: MemSize
: 40
95 // CHECK-PT-NEXT
: Flags
[ (0x4)
96 // CHECK-PT-NEXT
: PF_R
(0x4)
98 // CHECK-PT-NEXT
: Alignment
: 4