2 // RUN
: llvm-mc
-filetype
=obj
--arm-add-build-attributes
-triple
=armv7a-none-linux-gnueabi
%s
-o
%t
3 // RUN
: ld.lld
%t --no-merge-exidx-entries
-o
%t2
4 // RUN
: llvm-objdump
-s
%t2 | FileCheck
--check-prefix CHECK-DUPS
%s
5 // RUN
: ld.lld
%t -o
%t3
6 // RUN
: llvm-objdump
-s
%t3 | FileCheck
%s
8 /// Test that lld can at least remove duplicate
.ARM.exidx sections. A more
9 /// fine grained implementation will
be able to remove duplicate entries within
10 /// a .ARM.exidx section.
12 /// With duplicate entries
13 // CHECK-DUPS
: Contents of section
.ARM.exidx:
14 // CHECK-DUPS-NEXT
: 100d4
78000100 01000000 74000100 01000000
15 // CHECK-DUPS-NEXT
: 100e4
70000100 01000000 6c000100
01000000
16 // CHECK-DUPS-NEXT
: 100f4 68000100 08849780 64000100 08849780
17 // CHECK-DUPS-NEXT
: 10104 60000100 08849780 5c000100
24000000
18 // CHECK-DUPS-NEXT
: 10114 58000100 28000000 54000100 01000000
19 // CHECK-DUPS-NEXT
: 10124 50000100 01000000 4c000100
01000000
20 // CHECK-DUPS-NEXT
: Contents of section
.ARM.extab:
22 /// After duplicate entry removal
23 // CHECK
: Contents of section
.ARM.exidx:
24 // CHECK-NEXT
: 100d4
48000100 01000000 50000100 08849780
25 // CHECK-NEXT
: 100e4
54000100 1c000000
50000100 20000000
26 // CHECK-NEXT
: 100f4 4c000100
01000000 4c000100
01000000
27 // CHECK-NEXT
: Contents of section
.ARM.extab:
30 /// Expect
1 EXIDX_CANTUNWIND entry.
31 .section .text.00, "ax", %progbits
39 /// Expect
.ARM.exidx.text.01 to be identical to .ARM.exidx.text.00
40 .section .text.01, "ax", %progbits
48 /// Expect
2 EXIDX_CANTUNWIND entries
, these can
be duplicated into
50 .section .text.02, "ax", %progbits
65 /// Expect inline unwind instructions
, not a duplicate of previous entry.
66 .section .text.03, "ax", %progbits
75 /// Expect
2 inline unwind entries that are
a duplicate of
76 /// .ARM.exidx.text.03
77 .section .text.04, "ax", %progbits
94 /// Expect
a section with
a reference to an
.ARM.extab. Not a duplicate
95 /// of previous inline table entry.
96 .section .text.05, "ax",%progbits
101 .personality __gxx_personality_v0
106 /// Expect
a reference to an identical
.ARM.extab. We do not try to
107 /// deduplicate references to
.ARM.extab sections.
108 .section .text.06, "ax",%progbits
113 .personality __gxx_personality_v0
118 /// Dummy implementation of personality routines to satisfy reference from
120 /// Expect Linker generated EXIDX_CANTUNWIND tables
121 .section .text.__gcc_personality_v0, "ax", %progbits
122 .global __gxx_personality_v0
123 __gxx_personality_v0
:
126 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits
127 .global __aeabi_unwind_cpp_pr0
128 __aeabi_unwind_cpp_pr0
: