This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Crash in write_exp_msymbol for coff targets.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 16 Nov 2006 16:02:36 -0500
- Subject: Re: Crash in write_exp_msymbol for coff targets.
- References: <455CCFAD.6060407@portugalmail.pt>
On Thu, Nov 16, 2006 at 08:53:01PM +0000, Pedro Alves wrote:
> Hi all,
>
> The TLS without debugging info support introduced a bug for coff based
> targets.
> While printing for example a global symbol's value I am getting a
> segfault in parse.c:write_exp_msymbol,
> at:
> if (SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL)
>
> The problem is that minimal symbols may not have a bfd section set.
>
> The attached patch fixes it, but is it correct?
> I see in coffread.c, that prim_record_minimal_symbol_and_info is always
> called with a NULL
> bfd section, whilst in elfread.c, is is not. Is this a limitation of the
> coff format? Should coffread.c
> be fixed instead?
Honestly, I'm not quite sure. You've got the section index, so maybe
in prim_record_minimal_symbol_and_info it could fill in a NULL
bfd_section from the objfile sections table?
--
Daniel Jacobowitz
CodeSourcery