111 lines · plain
1@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \2@ RUN: | llvm-readobj -S --sd --sr - > %t3@ RUN: FileCheck %s < %t4@ RUN: FileCheck --check-prefixes=RELOC,RELOC-NOAND %s < %t5@ RUN: llvm-mc %s -triple=armv7-unknown-linux-androideabi -filetype=obj -o - \6@ RUN: | llvm-readobj -S --sd --sr - | FileCheck --check-prefix=RELOC %s7 8@ Check the compact pr0 model9 10 .syntax unified11 12 .section .TEST113 .globl func114 .align 215 .type func1,%function16func1:17 .fnstart18 .save {r11, lr}19 push {r11, lr}20 .setfp r11, sp21 mov r11, sp22 pop {r11, lr}23 mov pc, lr24 .fnend25 26 .section .TEST227 .globl func228 .align 229 .type func2,%function30func2:31 .fnstart32 .save {r11, lr}33 push {r11, lr}34 pop {r11, pc}35 .fnend36 37 38 39@-------------------------------------------------------------------------------40@ Check .TEST1 section41@-------------------------------------------------------------------------------42@ CHECK: Sections [43@ CHECK: Section {44@ CHECK: Name: .TEST145@ CHECK: SectionData (46@ CHECK: 0000: 00482DE9 0DB0A0E1 0048BDE8 0EF0A0E1 |.H-......H......|47@ CHECK: )48@ CHECK: }49 50 51@-------------------------------------------------------------------------------52@ Check .ARM.exidx.TEST1 section53@-------------------------------------------------------------------------------54@ CHECK: Section {55@ CHECK: Name: .ARM.exidx.TEST156@-------------------------------------------------------------------------------57@ 0x80 = Compact model 0, personality routine: __aeabi_unwind_cpp_pr058@ 0x9B = $sp can be found in $r1159@ 0x8480 = pop {r11, r14}60@-------------------------------------------------------------------------------61@ CHECK: SectionData (62@ CHECK: 0000: 00000000 80849B80 |........|63@ CHECK: )64@ CHECK: }65@-------------------------------------------------------------------------------66@ The first word should be relocated to .TEST1 section. Besides, on non-Android67@ there is another relocation entry for __aeabi_unwind_cpp_pr0, so that the68@ linker will keep __aeabi_unwind_cpp_pr0.69@-------------------------------------------------------------------------------70@ RELOC: Section {71@ RELOC: Name: .rel.ARM.exidx.TEST172@ RELOC: Relocations [73@ RELOC-NOAND-NEXT: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr074@ RELOC-NEXT: 0x0 R_ARM_PREL31 .TEST175@ RELOC-NEXT: ]76 77@-------------------------------------------------------------------------------78@ Check .TEST2 section79@-------------------------------------------------------------------------------80@ CHECK: Section {81@ CHECK: Name: .TEST282@ CHECK: SectionData (83@ CHECK: 0000: 00482DE9 0088BDE8 |.H-.....|84@ CHECK: )85@ CHECK: }86@-------------------------------------------------------------------------------87@ Check .ARM.exidx.TEST1 section88@-------------------------------------------------------------------------------89@ CHECK: Section {90@ CHECK: Name: .ARM.exidx.TEST291@-------------------------------------------------------------------------------92@ 0x80 = Compact model 0, personality routine: __aeabi_unwind_cpp_pr093@ 0x8480 = pop {r11, r14}94@ 0xB0 = finish95@-------------------------------------------------------------------------------96@ CHECK: SectionData (97@ CHECK: 0000: 00000000 B0808480 |........|98@ CHECK: )99@ CHECK: }100@-------------------------------------------------------------------------------101@ The first word should be relocated to .TEST2 section. Besides, on non-Android102@ there is another relocation entry for __aeabi_unwind_cpp_pr0, so that the103@ linker will keep __aeabi_unwind_cpp_pr0.104@-------------------------------------------------------------------------------105@ RELOC: Section {106@ RELOC: Name: .rel.ARM.exidx.TEST2107@ RELOC: Relocations [108@ RELOC-NOAND-NEXT: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0109@ RELOC-NEXT: 0x0 R_ARM_PREL31 .TEST2110@ RELOC-NEXT: ]111