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]

Re: [PATCH] RISC-V: Force variables to .data for code_elim.


* Jim Wilson <jimw@sifive.com> [2018-10-26 15:14:26 -0700]:

> 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.

This is fine with me.  Sorry for not reviewing this earlier.

Thanks,
Andrew



> ---
>  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]