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.


Hi Andrew,

While scanning my inbox, I saw this was unanswered.  This looks good to me,
but you (or Palmer) should probably approve.

Simon

On 2018-10-26 6:14 p.m., Jim Wilson wrote:
> 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}"
>  
> 


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