[llvm] 1e46bc7 - [JITLink][AArch32] Tests for ELF::R_ARM_ABS32 and ELF::R_ARM_REL32
Stefan Gränitz via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 03:34:57 PST 2023
Author: Eymen Ünay
Date: 2023-11-07T12:31:37+01:00
New Revision: 1e46bc73a4a45e4003da3f46ea941ce7ff725fc2
URL: https://github.com/llvm/llvm-project/commit/1e46bc73a4a45e4003da3f46ea941ce7ff725fc2
DIFF: https://github.com/llvm/llvm-project/commit/1e46bc73a4a45e4003da3f46ea941ce7ff725fc2.diff
LOG: [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
Added:
llvm/test/ExecutionEngine/JITLink/AArch32/ELF_static_data_reloc.s
Modified:
Removed:
################################################################################
diff --git a/llvm/test/ExecutionEngine/JITLink/AArch32/ELF_static_data_reloc.s b/llvm/test/ExecutionEngine/JITLink/AArch32/ELF_static_data_reloc.s
new file mode 100644
index 000000000000000..379d35fe4902cb0
--- /dev/null
+++ b/llvm/test/ExecutionEngine/JITLink/AArch32/ELF_static_data_reloc.s
@@ -0,0 +1,37 @@
+# RUN: llvm-mc -triple=armv7-none-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s
+# RUN: llvm-objdump -r %t_armv7.o | FileCheck --check-prefix=CHECK-TYPE %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb -slab-page-size 4096 \
+# RUN: -abs target=0x76bbe88f -check %s %t_armv7.o
+
+# RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
+# RUN: llvm-objdump -r %t_thumbv7.o | FileCheck --check-prefix=CHECK-TYPE %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb -slab-page-size 4096 \
+# RUN: -abs target=0x76bbe88f -check %s %t_thumbv7.o
+
+ .data
+ .global target
+
+ .text
+ .syntax unified
+
+# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_ABS32 target
+# jitlink-check: *{4}(abs32) = target
+ .global abs32
+abs32:
+ .word target
+ .size abs32, .-abs32
+
+# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_REL32 target
+# jitlink-check: (rel32 + *{4}(rel32))[31:0] = target
+ .global rel32
+rel32:
+ .word target - .
+ .size rel32, .-rel32
+
+# Empty main function for jitlink to be happy
+ .globl main
+ .type main, %function
+ .p2align 2
+main:
+ bx lr
+ .size main, .-main
More information about the llvm-commits
mailing list