Handle __start_* and __stop_* symbols in --gc-sections

PR ld/11133
	PR ld/19161
	PR ld/19167
	* elflink.c (_bfd_elf_gc_mark_hook): Delete code handling __start_*
	and __stop_* symbol refs.
	(_bfd_elf_gc_mark_rsec): Add start_stop parameter.  Handle __start_*
	and __stop_* symbol refs here..
	(_bfd_elf_gc_mark_reloc): ..and here.
	* elf-bfd.h (_bfd_elf_gc_mark_hook): Update prototype.
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update
	_bfd_elf_gc_mark_rsec call.
This commit is contained in:
Alan Modra 2015-10-23 22:23:05 +10:30
parent be83aa76d2
commit 1cce69b9dc
4 changed files with 82 additions and 39 deletions

View file

@ -902,7 +902,8 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
REQUIRE (GET_RELOC (buf));
/* Chain together the FDEs for each section. */
rsec = _bfd_elf_gc_mark_rsec (info, sec, gc_mark_hook, cookie);
rsec = _bfd_elf_gc_mark_rsec (info, sec, gc_mark_hook,
cookie, NULL);
/* RSEC will be NULL if FDE was cleared out as it was belonging to
a discarded SHT_GROUP. */
if (rsec)