[PATCH] PR ld/20828: Move symbol version processing ahead of GC symbol sweep

Alan Modra amodra@gmail.com
Thu Feb 2 03:25:00 GMT 2017


I think you may be in trouble here:

      if ((elf_tdata (output_bfd)->cverrefs == 0
	   && elf_tdata (output_bfd)->cverdefs == 0)
	  || _bfd_elf_link_renumber_dynsyms (output_bfd, info,
					     &section_sym_count) == 0)
	{
	  s = bfd_get_linker_section (dynobj, ".gnu.version");
	  s->flags |= SEC_EXCLUDE;
	}

The problem being that _bfd_elf_export_symbol and the backend
size_dynamic_sections might make symbols dynamic where there were
possibly none before.  Garbage collection also might change whether
there are dynamic symbols.

Another problem related to dynamic symbols is that running
_bfd_elf_link_assign_sym_version early means the tests of h->dynindx
in that function are no longer valid.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list