1 @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ 2 @ RUN: | llvm-readobj -s -sd -sr | FileCheck %s 3 4 @ Check the compact pr0 model 5 6 .syntax unified 7 8 .section .TEST1 9 .globl func1 10 .align 2 11 .type func1,%function 12 func1: 13 .fnstart 14 .save {r11, lr} 15 push {r11, lr} 16 .setfp r11, sp 17 mov r11, sp 18 pop {r11, lr} 19 mov pc, lr 20 .fnend 21 22 .section .TEST2 23 .globl func2 24 .align 2 25 .type func2,%function 26 func2: 27 .fnstart 28 .save {r11, lr} 29 push {r11, lr} 30 pop {r11, pc} 31 .fnend 32 33 34 35 @------------------------------------------------------------------------------- 36 @ Check .TEST1 section 37 @------------------------------------------------------------------------------- 38 @ CHECK: Sections [ 39 @ CHECK: Section { 40 @ CHECK: Name: .TEST1 41 @ CHECK: SectionData ( 42 @ CHECK: 0000: 00482DE9 0DB0A0E1 0048BDE8 0EF0A0E1 |.H-......H......| 43 @ CHECK: ) 44 @ CHECK: } 45 46 47 @------------------------------------------------------------------------------- 48 @ Check .ARM.exidx.TEST1 section 49 @------------------------------------------------------------------------------- 50 @ CHECK: Section { 51 @ CHECK: Name: .ARM.exidx.TEST1 52 @------------------------------------------------------------------------------- 53 @ 0x80 = Compact model 0, personality routine: __aeabi_unwind_cpp_pr0 54 @ 0x9B = $sp can be found in $r11 55 @ 0x8480 = pop {r11, r14} 56 @------------------------------------------------------------------------------- 57 @ CHECK: SectionData ( 58 @ CHECK: 0000: 00000000 80849B80 |........| 59 @ CHECK: ) 60 @ CHECK: } 61 @------------------------------------------------------------------------------- 62 @ The first word should be relocated to .TEST1 section. Besides, there is 63 @ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker 64 @ will keep __aeabi_unwind_cpp_pr0. 65 @------------------------------------------------------------------------------- 66 @ CHECK: Relocations [ 67 @ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 68 @ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 69 @ CHECK: ] 70 71 72 @------------------------------------------------------------------------------- 73 @ Check .TEST2 section 74 @------------------------------------------------------------------------------- 75 @ CHECK: Section { 76 @ CHECK: Name: .TEST2 77 @ CHECK: SectionData ( 78 @ CHECK: 0000: 00482DE9 0088BDE8 |.H-.....| 79 @ CHECK: ) 80 @ CHECK: } 81 @------------------------------------------------------------------------------- 82 @ Check .ARM.exidx.TEST1 section 83 @------------------------------------------------------------------------------- 84 @ CHECK: Section { 85 @ CHECK: Name: .ARM.exidx.TEST2 86 @------------------------------------------------------------------------------- 87 @ 0x80 = Compact model 0, personality routine: __aeabi_unwind_cpp_pr0 88 @ 0x8480 = pop {r11, r14} 89 @ 0xB0 = finish 90 @------------------------------------------------------------------------------- 91 @ CHECK: SectionData ( 92 @ CHECK: 0000: 00000000 B0808480 |........| 93 @ CHECK: ) 94 @ CHECK: } 95 @ CHECK: ] 96 @------------------------------------------------------------------------------- 97 @ The first word should be relocated to .TEST2 section. Besides, there is 98 @ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker 99 @ will keep __aeabi_unwind_cpp_pr0. 100 @------------------------------------------------------------------------------- 101 @ CHECK: Relocations [ 102 @ CHECK: 0x0 R_ARM_PREL31 .TEST2 0x0 103 @ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 104 @ CHECK: ] 105