brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 432392c Raw
60 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj --arm-add-build-attributes -o %t.o3// RUN: echo "SECTIONS { \4// RUN:          .text : { *(.text) } \5// RUN:          .prel.test : { *(.ARM.exidx) } \6// RUN:          .TEST1 : { *(.TEST1) } } " > %t.script7// RUN: ld.lld --script %t.script %t.o -o %t8// RUN: llvm-readobj -S --section-data %t | FileCheck --check-prefix=CHECK %s9 10// The R_ARM_PREL31 relocation is used in by the .ARM.exidx exception tables11// bit31 of the place denotes whether the field is an inline table entry12// (bit31=1) or relocation (bit31=0)13// The linker must preserve the value of bit3114 15// This test case is adapted from llvm/test/MC/ARM/eh-compact-pr0.s16// We use a linker script to place the .ARM.exidx sections in between17// the code sections so that we can test positive and negative offsets18 .syntax unified19 20 .section .TEST1, "ax",%progbits21 .globl _start22 .align 223 .type  _start,%function24_start:25 .fnstart26 .save   {r11, lr}27 push    {r11, lr}28 .setfp  r11, sp29 mov     r11, sp30 pop     {r11, lr}31 mov     pc, lr32 .fnend33 34 .section .text, "ax",%progbits35// The generated .ARM.exidx section will refer to the personality36// routine __aeabi_unwind_cpp_pr0. Provide a dummy implementation37// to stop an undefined symbol error38 .globl __aeabi_unwind_cpp_pr039 .align 240 .type __aeabi_unwind_cpp_pr0,%function41__aeabi_unwind_cpp_pr0:42 .fnstart43 bx lr44 .fnend45 46// The expected value of the exception table is47// Word0 0 in bit 31, -4 encoded in 31-bit signed offset48// Word1 Inline table entry EHT Inline Personality Routine #049// Word3 0 in bit 31, +10 encoded in 31-bit signed offset50// Word4 Inline table entry EHT Inline Personality Routine #051// set vsp = r1152// pop r11, r1453// Word5 Sentinel +18 EXIDX_CANTUNWIND54 55// CHECK:  Name: .prel.test56// CHECK:  SectionData (57// CHECK:     0000: FCFFFF7F B0B0B080 10000000 80849B8058// CHECK:     0010: 18000000 0100000059// CHECK:  )60