PATCH: Fix gold problem with weak undefined symbols

Ian Lance Taylor
Fri Apr 4 15:26:00 GMT 2008

"Cary Coutant" <> writes:

> This patch fixes a problem in gold where it incorrectly generates a
> dynamic relocation for a reference to a weak undefined symbol, or for
> a reference to an absolute symbol.

Based on this discussion, I think we should go ahead and commit this
to gold.  It makes gold act like GNU ld.  Clearly more thought is
required before changing the linker behaviour in this area.

> 2008-03-31  Cary Coutant  <>
> 	* symtab.h (Symbol::is_weak_undefined): New function.
> 	(Symbol::is_strong_undefined): New function.
> 	(Symbol::is_absolute): New function.
> 	(Symbol::needs_plt_entry): Exclude weak undefined symbols.
> 	(Symbol::needs_dynamic_reloc): Exclude weak undefined and
> 	absolute symbols.
> 	* testsuite/ (check_PROGRAMS): Add weak_undef_test.
> 	(weak_undef_test): New target.
> 	* testsuite/ Rebuild.
> 	* testsuite/ New file.
> 	* testsuite/ New file.
> 	* testsuite/ New file.

> +// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.

Change the copyright date to just 2008 for the new files.

This patch is OK with that change.



More information about the Binutils mailing list