130 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj --arm-add-build-attributes -triple=armv7a-none-linux-gnueabi %s -o %t3// RUN: ld.lld %t --no-merge-exidx-entries -o %t24// RUN: llvm-objdump -s %t2 | FileCheck --check-prefix CHECK-DUPS %s5// RUN: ld.lld %t -o %t36// RUN: llvm-objdump -s %t3 | FileCheck %s7 8/// Test that lld can at least remove duplicate .ARM.exidx sections. A more9/// fine grained implementation will be able to remove duplicate entries within10/// a .ARM.exidx section.11 12/// With duplicate entries13// CHECK-DUPS: Contents of section .ARM.exidx:14// CHECK-DUPS-NEXT: 100d4 78000100 01000000 74000100 0100000015// CHECK-DUPS-NEXT: 100e4 70000100 01000000 6c000100 0100000016// CHECK-DUPS-NEXT: 100f4 68000100 08849780 64000100 0884978017// CHECK-DUPS-NEXT: 10104 60000100 08849780 5c000100 2400000018// CHECK-DUPS-NEXT: 10114 58000100 28000000 54000100 0100000019// CHECK-DUPS-NEXT: 10124 50000100 01000000 4c000100 0100000020// CHECK-DUPS-NEXT: Contents of section .ARM.extab:21 22/// After duplicate entry removal23// CHECK: Contents of section .ARM.exidx:24// CHECK-NEXT: 100d4 48000100 01000000 50000100 0884978025// CHECK-NEXT: 100e4 54000100 1c000000 50000100 2000000026// CHECK-NEXT: 100f4 4c000100 01000000 4c000100 0100000027// CHECK-NEXT: Contents of section .ARM.extab:28 .syntax unified29 30 /// Expect 1 EXIDX_CANTUNWIND entry.31 .section .text.00, "ax", %progbits32 .globl _start33_start:34 .fnstart35 bx lr36 .cantunwind37 .fnend38 39 /// Expect .ARM.exidx.text.01 to be identical to .ARM.exidx.text.0040 .section .text.01, "ax", %progbits41 .globl f142f1:43 .fnstart44 bx lr45 .cantunwind46 .fnend47 48 /// Expect 2 EXIDX_CANTUNWIND entries, these can be duplicated into49 /// .ARM.exid.text.0050 .section .text.02, "ax", %progbits51 .globl f252f2:53 .fnstart54 bx lr55 .cantunwind56 .fnend57 58 .globl f359f3:60 .fnstart61 bx lr62 .cantunwind63 .fnend64 65 /// Expect inline unwind instructions, not a duplicate of previous entry.66 .section .text.03, "ax", %progbits67 .global f468f4:69 .fnstart70 bx lr71 .save {r7, lr}72 .setfp r7, sp, #073 .fnend74 75 /// Expect 2 inline unwind entries that are a duplicate of76 /// .ARM.exidx.text.0377 .section .text.04, "ax", %progbits78 .global f579f5:80 .fnstart81 bx lr82 .save {r7, lr}83 .setfp r7, sp, #084 .fnend85 86 .global f687f6:88 .fnstart89 bx lr90 .save {r7, lr}91 .setfp r7, sp, #092 .fnend93 94 /// Expect a section with a reference to an .ARM.extab. Not a duplicate95 /// of previous inline table entry.96 .section .text.05, "ax",%progbits97 .global f798f7:99 .fnstart100 bx lr101 .personality __gxx_personality_v0102 .handlerdata103 .long 0104 .fnend105 106 /// Expect a reference to an identical .ARM.extab. We do not try to107 /// deduplicate references to .ARM.extab sections.108 .section .text.06, "ax",%progbits109 .global f8110f8:111 .fnstart112 bx lr113 .personality __gxx_personality_v0114 .handlerdata115 .long 0116 .fnend117 118/// Dummy implementation of personality routines to satisfy reference from119/// exception tables120/// Expect Linker generated EXIDX_CANTUNWIND tables121 .section .text.__gcc_personality_v0, "ax", %progbits122 .global __gxx_personality_v0123__gxx_personality_v0:124 bx lr125 126 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits127 .global __aeabi_unwind_cpp_pr0128__aeabi_unwind_cpp_pr0:129 bx lr130