RISC-V: Force variables to .data for code_elim.
authorJim Wilson <jimw@sifive.com>
Tue, 6 Nov 2018 19:06:23 +0000 (11:06 -0800)
committerJim Wilson <jimw@sifive.com>
Tue, 6 Nov 2018 19:06:23 +0000 (11:06 -0800)
RISC-V puts a global variable in .sdata by default, which causes the
add-symbol-file commands with -s .data to fail as there is no .data section.
This fixes 3 testsuite failures.

gdb/testsuite/
* gdb.base/code_elim.exp: For riscv, set additional_flags
to include -msmall-data-limit=0.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/code_elim.exp

index 0df75aa54f28e7f3c1a0957a4b749ed8f253d8d1..24e4c9236dfc2ed39318887ee96f69bcb0ccab7d 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-06  Jim Wilson  <jimw@sifive.com>
+
+       * gdb.base/code_elim.exp: For riscv, set additional_flags
+       to include -msmall-data-limit=0.
+
 2018-11-01  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/watch_minus_l: New testcase.
index 962df4d773a85063f48732f40072d09c4335ba25..1c768277548795bd658cde9376928d22fad92409 100644 (file)
@@ -28,6 +28,11 @@ lappend opts "additional_flags=-fdata-sections"
 lappend opts "additional_flags=-Wl,-gc-sections"
 lappend opts "additional_flags=-Wl,-e,main"
 
+# Place variables in .data instead of .sdata.
+if {[istarget "riscv*-*-*"]} {
+   lappend opts "additional_flags=-msmall-data-limit=0"
+}
+
 remote_exec build "rm -f ${binfile1}"
 remote_exec build "rm -f ${binfile2}"