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] PR ld/20882: Mark debug sections referenced by kept debug sections


On Tue, May 16, 2017 at 01:06:18PM -0700, H.J. Lu wrote:
>        if (! debug_frag_seen)
> -	continue;
> +	{
> +	  if (has_kept_debug_info)
> +	    goto mark_kept_debug_info;
> +	  else
> +	    continue;
> +	}
>  
>        /* Look for CODE sections which are going to be discarded,
>  	 and find and discard any fragmented debug sections which

I think the loop handling .debug*.text.* should be run before your new
gc_mark loop.  ie. Rather than the above hunk, you should condition
the loop immediately after the comment as

      if (debug_frag_seen)
	for (isec = ibfd->sections; isec != NULL; isec = isec->next)
	  if ((isec->flags & SEC_CODE) != 0
	      && isec->gc_mark == 0)

OK with that change and of course deleting the goto label.  Also,
please tabify the testcase source files.

-- 
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]