Skip to content

Commit 517a484

Browse files
committed
[llvm-jitlink] Add -alias option, shorten "-define-abs" option to "-abs".
The -alias option can be used to define aliases within a JITDylib. The immediate motivation is to simplify testing of ORC runtime functions using existing testcases (e.g. by aliasing dlfcn functions to their ORC-runtime counterparts, like -alias dlopen=__orc_rt_macho_dlopen). The option is likely to be useful for testing in general. The -define-abs option is shortened to -abs for consistency with -alias.
1 parent f3a66ec commit 517a484

16 files changed

+77
-23
lines changed

llvm/test/ExecutionEngine/JITLink/AArch64/MachO_arm64_relocations.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: rm -rf %t && mkdir -p %t
22
# RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/macho_reloc.o %s
3-
# RUN: llvm-jitlink -noexec -define-abs external_data=0xdeadbeef -define-abs external_func=0xcafef00d -check=%s %t/macho_reloc.o
3+
# RUN: llvm-jitlink -noexec -abs external_data=0xdeadbeef -abs external_func=0xcafef00d -check=%s %t/macho_reloc.o
44

55
.section __TEXT,__text,regular,pure_instructions
66

llvm/test/ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# RUN: -o %t/elf_riscv32_non_pc_indirect_reloc.o %s
66
# RUN: llvm-jitlink -noexec \
77
# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
8-
# RUN: -define-abs external_data=0x1ff10000 \
8+
# RUN: -abs external_data=0x1ff10000 \
99
# RUN: -check %s %t/elf_riscv64_non_pc_indirect_reloc.o
1010
# RUN: llvm-jitlink -noexec \
1111
# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
12-
# RUN: -define-abs external_data=0x1ff10000 \
12+
# RUN: -abs external_data=0x1ff10000 \
1313
# RUN: -check %s %t/elf_riscv32_non_pc_indirect_reloc.o
1414
#
1515

llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# RUN: -o %t/elf_riscv32_branch.o %s
66
# RUN: llvm-jitlink -noexec \
77
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
8-
# RUN: -define-abs external_func=0xfe \
8+
# RUN: -abs external_func=0xfe \
99
# RUN: -check %s %t/elf_riscv64_branch.o
1010
# RUN: llvm-jitlink -noexec \
1111
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
12-
# RUN: -define-abs external_func=0xfe \
12+
# RUN: -abs external_func=0xfe \
1313
# RUN: -check %s %t/elf_riscv32_branch.o
1414
#
1515

llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# RUN: -o %t/elf_riscv32_sm_pic_reloc.o %s
66
# RUN: llvm-jitlink -noexec \
77
# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
8-
# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
8+
# RUN: -abs external_func=0x1 -abs external_data=0x2 \
99
# RUN: -check %s %t/elf_riscv64_sm_pic_reloc.o
1010
# RUN: llvm-jitlink -noexec \
1111
# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
12-
# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
12+
# RUN: -abs external_func=0x1 -abs external_data=0x2 \
1313
# RUN: -check %s %t/elf_riscv32_sm_pic_reloc.o
1414
#
1515
# Test ELF small/PIC relocations

llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv32_got_plt_reloc.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RUN: -o %t/elf_riscv32_got_plt_reloc.o %s
44
# RUN: llvm-jitlink -noexec \
55
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6-
# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
6+
# RUN: -abs external_func=0x1 -abs external_data=0x2 \
77
# RUN: -check %s %t/elf_riscv32_got_plt_reloc.o
88

99
.text

llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv64_got_plt_reloc.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RUN: -o %t/elf_riscv64_got_plt_reloc.o %s
44
# RUN: llvm-jitlink -noexec \
55
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6-
# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
6+
# RUN: -abs external_func=0x1 -abs external_data=0x2 \
77
# RUN: -check %s %t/elf_riscv64_got_plt_reloc.o
88

99

llvm/test/ExecutionEngine/JITLink/X86/ELF_ehframe_basic.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# UNSUPPORTED: system-windows
33
# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \
44
# RUN: -filetype=obj -o %t %s
5-
# RUN: llvm-jitlink -debug-only=jitlink -define-abs bar=0x01 \
6-
# RUN: -define-abs _ZTIi=0x02 -noexec %t 2>&1 | FileCheck %s
5+
# RUN: llvm-jitlink -debug-only=jitlink -abs bar=0x01 \
6+
# RUN: -abs _ZTIi=0x02 -noexec %t 2>&1 | FileCheck %s
77
#
88
# FIXME: This test should run on windows. Investigate spurious
99
# 'note: command had no output on stdout or stderr' errors, then re-enable.

llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_got_plt_optimizations.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RUN: -filetype=obj -o %t/elf_sm_pic_reloc.o %s
44
# RUN: llvm-jitlink -noexec \
55
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6-
# RUN: -define-abs extern_in_range32=0xffe00000 \
6+
# RUN: -abs extern_in_range32=0xffe00000 \
77
# RUN: -check %s %t/elf_sm_pic_reloc.o
88
#
99

llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_small_pic_relocations.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# RUN: -filetype=obj -o %t/elf_sm_pic_reloc.o %s
44
# RUN: llvm-jitlink -noexec \
55
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6-
# RUN: -define-abs external_data=0x1 \
7-
# RUN: -define-abs extern_out_of_range32=0x7fff00000000 \
6+
# RUN: -abs external_data=0x1 \
7+
# RUN: -abs extern_out_of_range32=0x7fff00000000 \
88
# RUN: -check %s %t/elf_sm_pic_reloc.o
99
#
1010
# Test ELF small/PIC relocations.

llvm/test/ExecutionEngine/JITLink/X86/ELF_x86_64_absolute_relocations.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# RUN: -filetype=obj -o %t/elf_abs_reloc.o %s
44
# RUN: llvm-jitlink -noexec \
55
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6-
# RUN: -define-abs external_data_low=0x1 \
7-
# RUN: -define-abs external_data_high=0xffffffff80000000 \
6+
# RUN: -abs external_data_low=0x1 \
7+
# RUN: -abs external_data_high=0xffffffff80000000 \
88
# RUN: -check %s %t/elf_abs_reloc.o
99
#
1010
# Test ELF absolute relocations.

0 commit comments

Comments
 (0)