Crash in write_exp_msymbol for coff targets.

Daniel Jacobowitz drow@false.org
Thu Nov 16 21:02:00 GMT 2006


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



More information about the Gdb-patches mailing list