This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch bfd]: Adjust handling for plugin-generated sections for pe-coff targets
- From: Alan Modra <amodra at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 29 Sep 2011 14:10:33 +0930
- Subject: Re: [patch bfd]: Adjust handling for plugin-generated sections for pe-coff targets
- References: <CAEwic4YyBYESy4W36A4pB1Dg0TuRC2xa5Yo7BLacYVAAojThQg@mail.gmail.com>
On Tue, Sep 27, 2011 at 02:37:22PM +0200, Kai Tietz wrote:
> diff -u -r1.79 cofflink.c
> --- bfd/cofflink.c 17 Aug 2011 00:39:38 -0000 1.79
> +++ bfd/cofflink.c 27 Sep 2011 11:21:47 -0000
> @@ -2318,7 +2327,9 @@
>
> if ((o->flags & SEC_LINKER_CREATED) != 0)
> continue;
> -
> + if (!bfd_is_abs_section (o)
> + && o->output_section == bfd_abs_section_ptr)
> + continue;
How is it that the earlier o->linker_mark test is not sufficient?
> if ((o->flags & SEC_HAS_CONTENTS) == 0
> || (o->size == 0 && (o->flags & SEC_RELOC) == 0))
> {
> @@ -2386,7 +2397,10 @@
> if (ps == NULL)
> continue;
> /* Complain if definition comes from an excluded section. */
> - if (ps->flags & SEC_EXCLUDE)
> + if ((ps->flags & SEC_EXCLUDE) != 0
> + && (ps->owner->flags & BFD_PLUGIN) == 0
> + && !bfd_is_abs_section (ps)
> + && bfd_is_abs_section ((ps)->output_section))
> (*finfo->info->callbacks->einfo)
> (_("%X`%s' referenced in section `%A' of %B: "
> "defined in discarded section `%A' of %B\n"),
I think this is wrong. You should never be applying a relocation
against a symbol defined in an IR section. If you are, then either ld
has failed to redefine the symbol properly when given a real
definition in LTO output, or gcc has failed to supply the real
definition. Either way, you shouldn't hide this error.
--
Alan Modra
Australia Development Lab, IBM