brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 075dfeb Raw
41 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o3// RUN: ld.lld %t.o -o %t4// RUN: llvm-objdump -d --triple=armv7a-none-linux-gnueabi %t | FileCheck %s5 6// Test the R_ARM_SBREL32 relocation which calculates the offset of the Symbol7// from the static base. We define the static base to be the address of the8// segment containing the symbol9 .text10 .syntax unified11 12 .globl _start13 .p2align       214 .type  _start,%function15_start:16        .fnstart17        bx lr18 19        .long   foo(sbrel)20        .long   foo2(sbrel)21        .long   foo3(sbrel)22        .long   foo4(sbrel)23// RW segment starts here24        .data25        .p2align 426foo:    .word 1027foo2:   .word 2028 29        .bss30foo3:   .space 431foo4:   .space 432 33// CHECK: Disassembly of section .text:34// CHECK-EMPTY:35// CHECK-NEXT: <_start>:36// CHECK-NEXT:    200d4:        e12fff1e        bx      lr37// CHECK:         200d8:        00 00 00 00     .word   0x0000000038// CHECK-NEXT:    200dc:        04 00 00 00     .word   0x0000000439// CHECK-NEXT:    200e0:        08 00 00 00     .word   0x0000000840// CHECK-NEXT:    200e4:        0c 00 00 00     .word   0x0000000c41