2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9676
	* elflink.c (elf_link_add_object_symbols): Update def_dynamic,
	ref_dynamic and dynamic_def fields when setting def_regular
	to 1.

ld/testsuite/

2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9676
	* ld-elf/pr9676-1.c: New.
	* ld-elf/pr9676-2.c: Likewiswe.
	* ld-elf/pr9676-3.c: Likewiswe.
	* ld-elf/pr9676-4.c: Likewiswe.
	* ld-elf/pr9676.rd: Likewiswe.

	* ld-elf/shared.exp (build_tests): Add tests for libpr9676-1.a,
	libpr9676-2.a, libpr9676-3.so, libpr9676-4.so and
	libpr9676-4a.so.

	* lib/ld-lib.exp (ar_simple_create): New.
	(run_ld_link_tests): Support archive.
	(run_cc_link_tests): Likewiswe.
This commit is contained in:
H.J. Lu 2009-01-02 16:48:11 +00:00
parent b70b5c14d5
commit d88805311b
12 changed files with 4535 additions and 4381 deletions

View file

@ -4296,7 +4296,15 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
h->ref_regular_nonweak = 1;
}
else
h->def_regular = 1;
{
h->def_regular = 1;
if (h->def_dynamic)
{
h->def_dynamic = 0;
h->ref_dynamic = 1;
h->dynamic_def = 1;
}
}
if (! info->executable
|| h->def_dynamic
|| h->ref_dynamic)