Skip to content

Commit 1e46bc7

Browse files
eymayweliveindetail
authored andcommitted
[JITLink][AArch32] Tests for ELF::R_ARM_ABS32 and ELF::R_ARM_REL32
Testing for Static Data relocations for both ARM and Thumb targets. Reviewed By: lhames, Eymay Differential Revision: https://reviews.llvm.org/D157519
1 parent 4428b01 commit 1e46bc7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# RUN: llvm-mc -triple=armv7-none-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s
2+
# RUN: llvm-objdump -r %t_armv7.o | FileCheck --check-prefix=CHECK-TYPE %s
3+
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb -slab-page-size 4096 \
4+
# RUN: -abs target=0x76bbe88f -check %s %t_armv7.o
5+
6+
# RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
7+
# RUN: llvm-objdump -r %t_thumbv7.o | FileCheck --check-prefix=CHECK-TYPE %s
8+
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb -slab-page-size 4096 \
9+
# RUN: -abs target=0x76bbe88f -check %s %t_thumbv7.o
10+
11+
.data
12+
.global target
13+
14+
.text
15+
.syntax unified
16+
17+
# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_ABS32 target
18+
# jitlink-check: *{4}(abs32) = target
19+
.global abs32
20+
abs32:
21+
.word target
22+
.size abs32, .-abs32
23+
24+
# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_REL32 target
25+
# jitlink-check: (rel32 + *{4}(rel32))[31:0] = target
26+
.global rel32
27+
rel32:
28+
.word target - .
29+
.size rel32, .-rel32
30+
31+
# Empty main function for jitlink to be happy
32+
.globl main
33+
.type main, %function
34+
.p2align 2
35+
main:
36+
bx lr
37+
.size main, .-main

0 commit comments

Comments
 (0)