diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ld-loongarch-elf/data-plt.s | 20 | ||||
-rw-r--r-- | ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp | 24 | ||||
-rw-r--r-- | ld/testsuite/ld-loongarch-elf/libjirl.s | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/ld/testsuite/ld-loongarch-elf/data-plt.s b/ld/testsuite/ld-loongarch-elf/data-plt.s new file mode 100644 index 0000000..faff052 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/data-plt.s @@ -0,0 +1,20 @@ +# The first version medium codel model function call is: pcalau12i + jirl. +# R_LARCH_PCALA_HI20 only need to generate PLT entry for function symbols. + .text + .globl a + + .data + .align 2 + .type a, @object + .size a, 4 +a: + .word 1 + + .text + .align 2 + .globl test + .type test, @function +test: + pcalau12i $r12,%pc_hi20(a) + ld.w $r12,$r12,%pc_lo12(a) + .size test, .-test diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp index 8dc04fe..64e644d 100644 --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp @@ -59,6 +59,30 @@ if [istarget "loongarch64-*-*"] { ] } + # loongarch*-elf target do not support -shared option + if [check_shared_lib_support] { + run_ld_link_tests \ + [list \ + [list \ + "data plt" \ + "-shared" "" \ + "" \ + {data-plt.s} \ + {} \ + "data-plt.so" \ + ] \ + ] + + if [file exist "tmpdir/data-plt.so"] { + set objdump_output [run_host_cmd "objdump" "-d tmpdir/data-plt.so"] + if { [ regexp "<a@plt>" $objdump_output] } { + fail "data plt" + } { + pass "data plt" + } + } + } + run_ld_link_tests \ [list \ [list \ diff --git a/ld/testsuite/ld-loongarch-elf/libjirl.s b/ld/testsuite/ld-loongarch-elf/libjirl.s index 4d96387..de028c5 100644 --- a/ld/testsuite/ld-loongarch-elf/libjirl.s +++ b/ld/testsuite/ld-loongarch-elf/libjirl.s @@ -1,2 +1,3 @@ +.type func @function pcalau12i $r12, %pc_hi20(func) jirl $r1,$r12, %pc_lo12(func) |