Revert
bba037e0, it breaks the gc-sections model. Instead fix the
underlying problem which is that _bfd_elf_gc_mark_hook is too late to
be setting SEC_KEEP.
PR ld/11133
PR ld/19161
* elflink.c (elf_gc_sweep): Revert last patch.
(_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.
+2015-10-23 Alan Modra <amodra@gmail.com>
+
+ PR ld/11133
+ PR ld/19161
+ * elflink.c (elf_gc_sweep): Revert last patch.
+ (_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.
+
2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/19161
{
sec = bfd_get_section_by_name (i, sec_name);
if (sec)
- sec->flags |= SEC_KEEP;
+ return sec;
}
}
break;
o->gc_mark = first->gc_mark;
}
- /* Always keep sections marked with SEC_KEEP. */
- if (o->gc_mark || (o->flags & SEC_KEEP))
+ if (o->gc_mark)
continue;
/* Skip sweeping sections already excluded. */