This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] RISC-V: Force variables to .data for code_elim.
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: Jim Wilson <jimw at sifive dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 6 Nov 2018 09:49:22 +0000
- Subject: Re: [PATCH] RISC-V: Force variables to .data for code_elim.
- References: <20181026221426.21608-1-jimw@sifive.com>
* 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
>