[llvm] [JITLink][AArch32] Fix Unaligned Data Symbol Address Resolution (PR #97030)
Stefan Gränitz via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 08:44:12 PDT 2024
================
@@ -0,0 +1,72 @@
+# RUN: llvm-mc -triple=armv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s
+# RUN: llvm-objdump -s --section=.rodata %t_armv7.o | FileCheck --check-prefix=CHECK-OBJ %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
+# RUN: -slab-page-size 4096 %t_armv7.o -debug-only=jitlink 2>&1 \
+# RUN: | FileCheck --check-prefix=CHECK-LG %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
+# RUN: -slab-page-size 4096 %t_armv7.o -check %s
+
+# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
+# RUN: llvm-objdump -s --section=.rodata %t_thumbv7.o | FileCheck --check-prefix=CHECK-OBJ %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
+# RUN: -slab-page-size 4096 %t_thumbv7.o -debug-only=jitlink 2>&1 \
+# RUN: | FileCheck --check-prefix=CHECK-LG %s
+# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
+# RUN: -slab-page-size 4096 %t_thumbv7.o -check %s
+
+# The strings of "H1\00", "H2\00" and "H3\00" are encoded as
+# 0x483100, 0x483200 and 0x483300 .rodata section.
+# CHECK-OBJ: Contents of section .rodata:
+# CHECK-OBJ: 0000 48310048 32004833 00 H1.H2.H3.
+
+# CHECK-LG: Starting link phase 1 for graph
+# CHECK-LG: section .rodata:
+
+# CHECK-LG: block 0x0 size = 0x00000009, align = 1, alignment-offset = 0
+# CHECK-LG-NEXT: symbols:
+# CHECK-LG-NEXT: 0x0 (block + 0x00000000): size: 0x00000003, linkage: strong, scope: default, live - Lstr.H1
+# CHECK-LG-NEXT: 0x3 (block + 0x00000003): size: 0x00000003, linkage: strong, scope: default, live - Lstr.H2
+# CHECK-LG-NOT: 0x2 (block + 0x00000002): size: 0x00000003, linkage: strong, scope: default, live - Lstr.H2
+# CHECK-LG-NEXT: 0x6 (block + 0x00000006): size: 0x00000003, linkage: strong, scope: default, live - Lstr.H3
+
+# FIXME: The expression we want is either *{3}(Lstr.H1) = ...
+# or *{4}(Lstr.H1) & 0x00ffffff = ...
+# The first is not supported and the latter segfaults.
+# Also, whitespaces are not recognized and not consumed by the checker.
----------------
weliveindetail wrote:
I think you could write either `(*{4}(Lstr.H1))[23:0]` or `(*{4}(Lstr.H1)) & 0x00ffffff`. Does that work?
https://github.com/llvm/llvm-project/pull/97030
More information about the llvm-commits
mailing list