PATCH: Fix gold problem with weak undefined symbols

Ian Lance Taylor iant@google.com
Fri Apr 4 15:26:00 GMT 2008


"Cary Coutant" <ccoutant@google.com> 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  <ccoutant@google.com>
>
> 	* 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/Makefile.am (check_PROGRAMS): Add weak_undef_test.
> 	(weak_undef_test): New target.
> 	* testsuite/Makefile.in: Rebuild.
> 	* testsuite/weak_undef_file1.cc: New file.
> 	* testsuite/weak_undef_file2.cc: New file.
> 	* testsuite/weak_undef_test.cc: 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.

Thanks.

Ian



More information about the Binutils mailing list