This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch bfd]: Adjust handling for plugin-generated sections for pe-coff targets


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]