From: Jim Wilson Date: Tue, 6 Nov 2018 19:06:23 +0000 (-0800) Subject: RISC-V: Force variables to .data for code_elim. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=109be305bb6acf7604f95411f333549f33a673bb;p=binutils-gdb.git RISC-V: Force variables to .data for code_elim. 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. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0df75aa54f2..24e4c9236df 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-06 Jim Wilson + + * gdb.base/code_elim.exp: For riscv, set additional_flags + to include -msmall-data-limit=0. + 2018-11-01 Joel Brobecker * gdb.ada/watch_minus_l: New testcase. diff --git a/gdb/testsuite/gdb.base/code_elim.exp b/gdb/testsuite/gdb.base/code_elim.exp index 962df4d773a..1c768277548 100644 --- a/gdb/testsuite/gdb.base/code_elim.exp +++ b/gdb/testsuite/gdb.base/code_elim.exp @@ -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}"