aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-01-08 17:55:29 -0800
committerJim Wilson <jimw@sifive.com>2018-01-08 17:55:29 -0800
commit7615ca1dc941bb9f225a1c50df7fdd8d31afc9e8 (patch)
treebf511a824e970fc250df7de7c2ecf2593e6b362f /ld
parent933ea656af9d40604e4823b07b83e74714f2516e (diff)
downloadgdb-7615ca1dc941bb9f225a1c50df7fdd8d31afc9e8.zip
gdb-7615ca1dc941bb9f225a1c50df7fdd8d31afc9e8.tar.gz
gdb-7615ca1dc941bb9f225a1c50df7fdd8d31afc9e8.tar.bz2
RISC-V: Fix accidental embedded -shared regressions.
ld/ * testsuite/ld-riscv-elf/c-lui.d: Don't use -shared. Check for _start instead of .text. * testsuite/ld-riscv-elf/c-lui.s: Add _start label. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Before __global_pointer$ tests, add call to check_shared_lib_support.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-riscv-elf/c-lui.d4
-rw-r--r--ld/testsuite/ld-riscv-elf/c-lui.s4
-rw-r--r--ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp5
4 files changed, 18 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8825b2e..19ff34e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2018-01-08 Jim Wilson <jimw@sifive.com>
+
+ * testsuite/ld-riscv-elf/c-lui.d: Don't use -shared. Check for _start
+ instead of .text.
+ * testsuite/ld-riscv-elf/c-lui.s: Add _start label.
+ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Before __global_pointer$
+ tests, add call to check_shared_lib_support.
+
2018-01-05 Jim Wilson <jimw@sifive.com>
* testsuite/ld-riscv-elf/disas-jalr.d: New.
diff --git a/ld/testsuite/ld-riscv-elf/c-lui.d b/ld/testsuite/ld-riscv-elf/c-lui.d
index 7a96711..382eca8 100644
--- a/ld/testsuite/ld-riscv-elf/c-lui.d
+++ b/ld/testsuite/ld-riscv-elf/c-lui.d
@@ -1,7 +1,7 @@
#name: lui to c.lui relaxation
#source: c-lui.s
#as: -march=rv32ic
-#ld: -shared -melf32lriscv
+#ld: -melf32lriscv
#objdump: -d -M no-aliases,numeric
.*: file format .*
@@ -9,7 +9,7 @@
Disassembly of section \.text:
-.* <.text>:
+.* <_start>:
.*: 6085 c.lui x1,0x1
.*: 000000b7 lui x1,0x0
.*: 00001037 lui x0,0x1
diff --git a/ld/testsuite/ld-riscv-elf/c-lui.s b/ld/testsuite/ld-riscv-elf/c-lui.s
index 4a23fdb..7159047 100644
--- a/ld/testsuite/ld-riscv-elf/c-lui.s
+++ b/ld/testsuite/ld-riscv-elf/c-lui.s
@@ -1,4 +1,6 @@
-.text
+ .text
+ .globl _start
+_start:
lui x1, 1
lui x1, 0
lui x0, 1
diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
index 5b5d2ea..2b6a1d7 100644
--- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
+++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
@@ -23,6 +23,11 @@ if [istarget "riscv*-*-*"] {
run_dump_test "c-lui"
run_dump_test "disas-jalr"
+ # The following tests require shared library support.
+ if ![check_shared_lib_support] {
+ return
+ }
+
set abis { rv32gc ilp32 elf32lriscv rv64gc lp64 elf64lriscv }
foreach { arch abi emul } $abis {
# This checks whether our linker scripts handle __global_pointer$