summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp1
-rw-r--r--ld/testsuite/ld-riscv-elf/relax-max-align-gp.d46
-rw-r--r--ld/testsuite/ld-riscv-elf/relax-max-align-gp.s28
3 files changed, 75 insertions, 0 deletions
diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
index 43572c5286b..9e103b283f7 100644
--- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
+++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
@@ -171,6 +171,7 @@ if [istarget "riscv*-*-*"] {
run_dump_test "attr-merge-priv-spec-failed-05"
run_dump_test "attr-merge-priv-spec-failed-06"
run_dump_test "attr-phdr"
+ run_dump_test "relax-max-align-gp"
run_ld_link_tests [list \
[list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \
"-march=rv32i -mabi=ilp32" {weakref32.s} \
diff --git a/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d
new file mode 100644
index 00000000000..637de426ee4
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d
@@ -0,0 +1,46 @@
+#source: relax-max-align-gp.s
+#ld:
+#objdump: -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+[0-9a-f]+ <_start>:
+.*:[ ]+[0-9a-f]+[ ]+add[ ]+.*<gdata>
+.*:[ ]+[0-9a-f]+[ ]+jal[ ]+.*
+.*:[ ]+[0-9a-f]+[ ]+j[ ]+.*
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+.*:[ ]+[0-9a-f]+[ ]+nop
+
+0+[0-9a-f]+ <func>:
+.*:[ ]+[0-9a-f]+[ ]+ret
+[ ]+...
diff --git a/ld/testsuite/ld-riscv-elf/relax-max-align-gp.s b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.s
new file mode 100644
index 00000000000..ce3da21e7f4
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.s
@@ -0,0 +1,28 @@
+
+.global _start
+_start:
+ lui a0, %hi(gdata)
+ addi a0, a0, %lo(gdata)
+ call func
+ j .
+ .size _start, . - _start
+
+.global func
+.align 7
+func:
+ ret
+ .size func, . - func
+
+.data
+padding:
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .size padding, . - padding
+
+.global gdata
+.type gdata, object
+gdata:
+ .zero 4
+ .size gdata, . - gdata