This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix gdb.base/code_elim.exp failures for PowerPC 32-bit
- From: Samuel Bronson <naesten at gmail dot com>
- To: <lgustavo at codesourcery dot com>
- Cc: "'gdb-patches\ at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Mon, 07 Jul 2014 21:52:48 -0400
- Subject: Re: [PATCH] Fix gdb.base/code_elim.exp failures for PowerPC 32-bit
- Authentication-results: sourceware.org; auth=none
- References: <53B28365 dot 1010508 at codesourcery dot com>
Luis Machado <lgustavo@codesourcery.com> writes:
> For PowerPC 32-bit though, the small initialized global int variable
> is sent to the .sdata section as an optimization. Since there is no
> more data to store, the .data section doesn't get created.
>
> GDB complains about the lack of such a section and expect doesn't like
> seeing that warning, which results in a couple failures for powerpc.
Hmm, seems like a silly thing to complain about ...
> One of them:
>
> [snip]
> add-symbol-file gdb.base/code_elim2 0x200000 -s .data 0x210000 -s .bss 0x220000^M
> add symbol table from file "gdb.d/gdb.base/code_elim2" at^M
> .text_addr = 0x200000^M
> .data_addr = 0x210000^M
> .bss_addr = 0x220000^M
> (y or n) y^M
> Reading symbols from gdb.base/code_elim2...warning: section .data not
> found in gdb.base/code_elim2^M
> done.^M
> (gdb) FAIL: gdb.base/code_elim.exp: order1: add-symbol-file code_elim2
> 0x200000
>
> I have tweaked the testcase sources a little to hold a bigger
> initialized global variable, forcing the linker to create a regular
> .data section in order to prevent GDB's warning. The testcase still
> runs fine, but now PowerPC 32-bit sees full passes on this one.
Is tweaking the testcase really the best approach here? Shouldn't GDB
just be less picky?