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] Always keep sections marked with SEC_KEEP


On Fri, Oct 23, 2015 at 10:21:57AM +1030, Alan Modra wrote:
> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index 2ed07e0..0bec93d 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -12109,7 +12109,7 @@ _bfd_elf_gc_mark_hook (asection *sec,
>  		{
>  		  sec = bfd_get_section_by_name (i, sec_name);
>  		  if (sec)
> -		    sec->flags |= SEC_KEEP;
> +		    return sec;
>  		}
>  	    }
>  	  break;

BTW, I'm not sure what should happen if there are multiple input
sections mapping to an output section with __start_ and __stop_
symbols.  The above change just keeps the first one whereas before you
attempted to keep them all.

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