Commit d2ea9f3a authored by Alan Modra's avatar Alan Modra
Browse files

PR27311, ld.bfd (symbol from plugin): undefined reference

A default versioned symbol definition in a shared library is
overridden by an unversioned definition in a regular object file, and
thus should not be reason to make an as-needed library needed.

bfd/
	PR 27311
	* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
	libraries when H is an indirect symbol after calling
	_bfd_elf_add_default_symbol.
ld/
	* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
	Link with --as-needed.

	* testsuite/ld-plugin/pr27311.d,
	* testsuite/ld-plugin/pr27311.ver,
	* testsuite/ld-plugin/pr27311a.c,
	* testsuite/ld-plugin/pr27311b.c,
	* testsuite/ld-plugin/pr27311c.c: New testcase.
	* testsuite/ld-plugin/lto.exp: Run it.  Correct PR14918 and
	PR12982 entries.

(cherry picked from commit 9918bff7)
(cherry picked from commit 69551367)
(cherry picked from commit f01fb44c)
parent ee6dd624
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment