This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 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.

Jim

	gdb/testsuite/
	* gdb.base/code_elim.exp: For riscv, set additional_flags
	to include -msmall-data-limit=0.
---
 gdb/testsuite/gdb.base/code_elim.exp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdb/testsuite/gdb.base/code_elim.exp b/gdb/testsuite/gdb.base/code_elim.exp
index 962df4d773..1c76827754 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}"
 
-- 
2.17.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]