87 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 --emit-relocs %t -o %t24// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck %s5// RUN: llvm-readelf --relocs %t2 | FileCheck -check-prefix=CHECK-RELOCS %s6 7// RUN: llvm-mc -filetype=obj --arm-add-build-attributes -triple=armv7aeb-none-linux-gnueabi -mcpu=cortex-a8 %s -o %t8// RUN: ld.lld --emit-relocs %t -o %t29// RUN: llvm-objdump -s --triple=armv7aeb-none-linux-gnueabi %t2 | FileCheck -check-prefix=CHECK-EB %s10// RUN: llvm-readelf --relocs %t2 | FileCheck -check-prefix=CHECK-RELOCS %s11 12// RUN: ld.lld --be8 --emit-relocs %t -o %t213// RUN: llvm-objdump -s --triple=armv7aeb-none-linux-gnueabi %t2 | FileCheck -check-prefix=CHECK-EB %s14// RUN: llvm-readelf --relocs %t2 | FileCheck -check-prefix=CHECK-RELOCS %s15 16/// LLD does not support --emit-relocs for .ARM.exidx sections as the relocations17/// from synthetic table entries won't be represented. Given the known use cases18/// of --emit-relocs, relocating kernels, and binary analysis, the former doesn't19/// use exceptions and the latter can derive the relocations from the table if20/// they need them.21 .syntax unified22 /// Will produce an ARM.exidx entry with inline unwinding instructions23 .section .text.func1, "ax",%progbits24 .global func125func1:26 .fnstart27 bx lr28 .save {r7, lr}29 .setfp r7, sp, #030 .fnend31 32 .syntax unified33 .section .text.func2, "ax",%progbits34/// A function with the same inline unwinding instructions, expect merge.35 .global func236func2:37 .fnstart38 bx lr39 .save {r7, lr}40 .setfp r7, sp, #041 .fnend42 43 .section .text.25, "ax", %progbits44 .global func2545func25:46 .fnstart47 bx lr48 .cantunwind49 .fnend50 51 .section .text.26, "ax", %progbits52 .global func2653func26:54 .fnstart55 bx lr56 .cantunwind57 .fnend58 59 .syntax unified60 .section .text.func3, "ax",%progbits61/// A function with the same inline unwinding instructions, expect merge.62 .global func363func3:64 .fnstart65 bx lr66 .save {r7, lr}67 .setfp r7, sp, #068 .fnend69 70 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits71 .global __aeabi_unwind_cpp_pr072__aeabi_unwind_cpp_pr0:73 bx lr74 75// CHECK: Contents of section .ARM.exidx:76// CHECK-NEXT: 100d4 28000100 08849780 28000100 0100000077// CHECK-NEXT: 100e4 28000100 08849780 24000100 0100000078// CHECK-NEXT: 100f4 20000100 0100000079 80// CHECK-RELOCS-NOT: Relocation section '.rel.ARM.exidx'81 82// CHECK-EB: Contents of section .ARM.exidx:83// CHECK-EB-NEXT: 100d4 00010028 80978408 00010028 0000000184// CHECK-EB-NEXT: 100e4 00010028 80978408 00010024 0000000185// CHECK-EB-NEXT: 100f4 00010020 0000000186 87