RISC-V: Fix accidental embedded -shared regressions.
authorJim Wilson <jimw@sifive.com>
Tue, 9 Jan 2018 01:55:29 +0000 (17:55 -0800)
committerJim Wilson <jimw@sifive.com>
Tue, 9 Jan 2018 01:55:29 +0000 (17:55 -0800)
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.

ld/ChangeLog
ld/testsuite/ld-riscv-elf/c-lui.d
ld/testsuite/ld-riscv-elf/c-lui.s
ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp

index 8825b2e7089959c78fb297c052476c66ab95173e..19ff34e46fc62574579cc4373458abc4a21f6bbf 100644 (file)
@@ -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.
index 7a9671163a9df691ba5fb33f9bdc0613163e7574..382eca88dc204a19103c054472b94e7fbf7341fb 100644 (file)
@@ -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
index 4a23fdb95c566fa6e07b801e872f16713029bd09..7159047afbdaab94536c0c43a065e68237ffca53 100644 (file)
@@ -1,4 +1,6 @@
-.text  
+       .text
+       .globl _start
+_start:
        lui x1, 1
        lui x1, 0
        lui x0, 1
index 5b5d2ea004dbb8a7a1b585856d839a301d8d209a..2b6a1d78fecd661f83a023eb62af35abd35f699f 100644 (file)
@@ -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$