[PATCH] Always keep sections marked with SEC_KEEP
Alan Modra
amodra@gmail.com
Fri Oct 23 01:16:00 GMT 2015
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
More information about the Binutils
mailing list