Allow for __gnu_lto_slim prefixed with extra "_"

Some targets prefix global symbols with "_".

bfd/
	* archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
	optionally prefixed with "_".
	* linker.c (_bfd_generic_link_add_one_symbol): Likewise.
binutils/
	* nm.c (filter_symbols): Match "__gnu_lto_slim" optionally prefixed
	with "_".
gold/
	* symtab.cc (Symbol_table::add_from_relobj): Match "__gnu_lto_slim"
	optionally prefixed with "_".
ld/
	* testsuite/ld-plugin/lto-3r.d: Match "__gnu_lto_v" optionally
	prefixed with "_".
	* testsuite/ld-plugin/lto-5r.d: Likewise.
This commit is contained in:
Alan Modra 2017-10-25 15:32:52 +10:30
parent 94092126a0
commit e601d38b7c
10 changed files with 38 additions and 6 deletions

View file

@ -1403,7 +1403,9 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
{
row = COMMON_ROW;
if (!bfd_link_relocatable (info)
&& strcmp (name, "__gnu_lto_slim") == 0)
&& name[0] == '_'
&& name[1] == '_'
&& strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0)
_bfd_error_handler
(_("%B: plugin needed to handle lto object"), abfd);
}