This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: debug_info strangeness (arm-mingw32ce)
- From: Danny Backx <danny dot backx at scarlet dot be>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils <binutils at sourceware dot org>
- Date: Thu, 03 Dec 2009 21:10:25 +0100
- Subject: Re: debug_info strangeness (arm-mingw32ce)
- References: <1258628885.5171.275.camel@pavilion> <20091119120423.GA24438@bubble.grove.modra.org> <1258652224.5171.290.camel@pavilion> <20091119211601.GB24438@bubble.grove.modra.org> <1258907946.5171.322.camel@pavilion> <1259264606.5171.363.camel@pavilion> <20091127010854.GB692@bubble.grove.modra.org> <1259418805.5171.385.camel@pavilion> <20091130101520.GD692@bubble.grove.modra.org> <1259780646.5171.412.camel@pavilion> <20091202224909.GI692@bubble.grove.modra.org>
- Reply-to: danny dot backx at scarlet dot be
On Thu, 2009-12-03 at 09:19 +1030, Alan Modra wrote:
> On Wed, Dec 02, 2009 at 08:04:06PM +0100, Danny Backx wrote:
> > Anyway : in _bfd_coff_final_link (bfd/cofflink.c) around line 900 in
> > current binutils head, this code is present :
> >
> > for (o = abfd->sections; o != NULL; o = o->next)
> > {
> > for (p = o->map_head.link_order; p != NULL; p = p->next)
> > {
> > if (p->type == bfd_indirect_link_order
> > && bfd_family_coff (p->u.indirect.section->owner))
> > {
> > sub = p->u.indirect.section->owner;
> > if (! bfd_coff_link_output_has_begun (sub, & finfo))
> > {
> > if (! _bfd_coff_link_input_bfd (&finfo, sub))
> > goto error_return;
> > sub->output_has_begun = TRUE;
> > }
> >
> > Not being a binutils expert, this code is not easy for me to understand.
> >
> > What appears to happen is that _bfd_coff_link_input_bfd is not called
> > for the .debug_info section of crt3.o, because
> > bfd_coff_link_output_has_begun evaluates to false.
>
> _bfd_coff_link_input_bfd is supposed to be called just once for each
> input file, and handles all the sections in the file. So your crt3.o
> .debug_info section should have been processed when the above loop was
> looking at earlier output sections, most likely .text.
Then it looks like the check (see above) should not be
if (! bfd_coff_link_output_has_begun (sub, & finfo))
but simply
if (! sub->output_has_begun)
This change makes my simple test magically work :-)
But I wonder about this (in coff-arm.c) :
/* This piece of machinery exists only to guarantee that the bfd that
holds
the glue section is written last.
This does depend on bfd_make_section attaching a new section to the
end of the section list for the bfd. */
static bfd_boolean
coff_arm_link_output_has_begun (bfd * sub, struct coff_final_link_info *
info)
{
return (sub->output_has_begun
|| sub == coff_arm_hash_table
(info->info)->bfd_of_glue_owner);
}
I don't understand what it means.
Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info