aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-riscv-elf/code-model-medlow-02.d
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2021-12-14 12:53:48 +0800
committerNelson Chu <nelson.chu@sifive.com>2021-12-14 13:21:20 +0800
commitfdb2b35b8fdbd5a6c136db326c73582dbfb335f8 (patch)
tree8f9b5aa7b7d5c8cd69df0812ebacf3304abd5f11 /ld/testsuite/ld-riscv-elf/code-model-medlow-02.d
parent527b8861cd472385fa9160a91dd6d65a25c41987 (diff)
downloadgdb-fdb2b35b8fdbd5a6c136db326c73582dbfb335f8.zip
gdb-fdb2b35b8fdbd5a6c136db326c73582dbfb335f8.tar.gz
gdb-fdb2b35b8fdbd5a6c136db326c73582dbfb335f8.tar.bz2
RISC-V: Added ld testcases for the medlow and medany code models.
There are two linker scripts, code-model-01.ld and code-model-02.ld, which are corresponding to the two different memory layouts, * code-model-01.ld: the text section is in the 32-bit address range, but the data section is far away from the text section, which means the data section is over the 32-bit address range. * code-model-02.ld: the text section is over the 32-bit address range, but the data section is placed nearly zero address. We use the two linker scripts, to test the current medlow and medany behaviors of GNU ld, including the weak symbol references and the relaxations behaviors. Besides, these testcases also show the limits of the current medlow and medany code models, that is - we may get the truncated to fit errors when linking with the above two linker scripts. ld/ * testsuite/ld-riscv-elf/code-model-01.ld: New testcases to test the behaviors of the current medlow and medany code models. * testsuite/ld-riscv-elf/code-model-02.ld: Likewise. * testsuite/ld-riscv-elf/code-model-medany-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-medany-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-medany-weakref-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-medany-weakref-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-medlow-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-medlow-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-medlow-weakref-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-medlow-weakref-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medany-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medany-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medany-weakref-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medany-weakref-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medlow-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medlow-02.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medlow-weakref-01.d: Likewise. * testsuite/ld-riscv-elf/code-model-relax-medlow-weakref-02.d: Likewise. * testsuite/ld-riscv-elf/code-model.s: Likewise. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
Diffstat (limited to 'ld/testsuite/ld-riscv-elf/code-model-medlow-02.d')
-rw-r--r--ld/testsuite/ld-riscv-elf/code-model-medlow-02.d15
1 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-riscv-elf/code-model-medlow-02.d b/ld/testsuite/ld-riscv-elf/code-model-medlow-02.d
new file mode 100644
index 0000000..1168863
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/code-model-medlow-02.d
@@ -0,0 +1,15 @@
+#source: code-model.s
+#as: -march=rv64i -mabi=lp64 --defsym __medlow__=1
+#ld: -Tcode-model-02.ld -melf64lriscv --no-relax
+#objdump: -d -Mno-aliases
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+800000000 <_start>:
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+lui[ ]+t0,0x[0-9a-f]+
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+addi[ ]+t0,t0,[0-9]+ # [0-9a-f]+ <symbolL>
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+lui[ ]+t0,0x[0-9a-f]+
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+addi[ ]+t0,t0,[0-9]+ # [0-9a-f]+ <symbolG>