[gold patch] Fix problem with --export-dynamic-symbol and versioned symbols

Ian Lance Taylor iant@google.com
Tue May 22 22:42:00 GMT 2012

Cary Coutant <ccoutant@google.com> writes:

> The --dynamic-list and --export-dynamic-symbol options can trigger an
> internal error in Symbol_table::sized_finalize_symbol() if a named
> symbol is referenced with a version from a dynamic object. In that
> case, we try to force a dynamic symbol table entry for the versioned
> symbol in the dynamic object. This patch fixes the problem by forcing
> the dynamic symbol table entry only after checking that the symbol is
> defined in a non-shared object.
> Tested on x86_64. OK to commit?
> -cary
> 2012-05-22  Cary Coutant  <ccoutant@google.com>
> 	* symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
> 	object before exporting symbol.

Seems like this would do the wrong thing for

ld --defsym=foo=0 --export-dynamic-symbol=foo


More information about the Binutils mailing list