2010-08-12 Cary Coutant <ccoutant@google.com>

Doug Kwan  <dougkwan@google.com>

	* resolve.cc (Symbol_table::should_override): When a weak dynamic
	defintion overrides non-weak undef, remember that the original undef
	is not weak.
	* symtab.cc (Symbol_table::sized_write_global): For undef without
	an original weak binding, set binding to global in output.
	* testsuite/Makefile.am: Add new test strong_ref_weak_def.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/strong_ref_weak_def.sh: New file.
	* testsuite/strong_ref_weak_def_1.c: Ditto.
	* testsuite/strong_ref_weak_def_2.c: Ditto.
This commit is contained in:
Doug Kwan
2010-08-13 00:18:19 +00:00
parent e06bb621df
commit 74f6756095
8 changed files with 181 additions and 3 deletions

View File

@@ -576,6 +576,11 @@ Symbol_table::should_override(const Symbol* to, unsigned int frombits,
return false;
case UNDEF * 16 + DYN_WEAK_DEF:
// When overriding an undef by a dynamic weak definition,
// we need to remember that the original undef was not weak.
*adjust_dyndef = true;
return true;
case DYN_UNDEF * 16 + DYN_WEAK_DEF:
case DYN_WEAK_UNDEF * 16 + DYN_WEAK_DEF:
// Use a weak dynamic definition if we have a reference.