This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] gdb.dwarf2: Define and use gdb_target_symbol_prefix for symbol prefixes
- From: Pedro Alves <palves at redhat dot com>
- To: Kevin Buettner <kevinb at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 30 Oct 2015 11:11:33 +0000
- Subject: Re: [PATCH] gdb.dwarf2: Define and use gdb_target_symbol_prefix for symbol prefixes
- Authentication-results: sourceware.org; auth=none
- References: <20151029212509 dot 438b5642 at pinnacle dot lan> <20151029222505 dot 3bb590b9 at pinnacle dot lan>
On 10/30/2015 05:25 AM, Kevin Buettner wrote:
> On Thu, 29 Oct 2015 21:25:09 -0700
> Kevin Buettner <email@example.com> wrote:
>> Some of the tests in gdb.dwarf2 which use Dwarf::assemble refer to
>> (minimal/linker) symbols created in the course of building a small
>> test program. Some targets use a prefix such as underscore ("_") on
>> these symbols. Many of the tests in gdb.dwarf2 do not take this into
>> account. As a consequence, these tests fail to build, resulting
>> either in failures or untested testcases.
> Several of the .S files in gdb.dwarf2 have the same problem. E.g.
> when linking the test case for gdb.dwarf2/method-ptr.exp, I see a
> linker error "undefined reference to `main'". It appears that crt0
> is generating a reference to _main, but the .S file only provides a
> reference to main.
> Any thoughts on what to do about this?
Isn't this being addressed by gdb_target_symbol_prefix_flags in
the existing tests that use it? E.g., gdb.arch/i386-bp_permanent.c:
#define SYMBOL(str) SYMBOL_PREFIX #str
#define SYMBOL(str) #str
" .align 8\n"
SYMBOL (standard) ":\n"