gold patch committed: handle empty version tag

Ian Lance Taylor iant@google.com
Wed Jul 23 23:46:00 GMT 2008


PR 6647 is about a version script which omits the version tag.  This
is useful if all you want to do is force some symbols in a shared
library to be local, and you don't want to mark up the source code
with annotations about symbol visibility.  Unfortunately, empty
version tags crashed gold.

I committed this patch to fix the problem, along with a test case.

Ian


2008-07-23  Ian Lance Taylor  <iant@google.com>

	PR 6647
	* script.cc (Version_script_info::get_versions): Don't add empty
	version tag to return value.
	(Version_script_info::get_symbol_version_helper): Change return
	type to bool.  Add pversion parameter.  Change all callers.
	(script_register_vers_node): Don't require a non-NULL tag.
	* script.h (class Version_script_info): Update declarations.
	(Version_script_info::get_symbol_version): Change return type to
	bool.  Add version parameter.  Change all callers.
	* symtab.cc (Sized_symbol::add_from_relobj): Rework version
	handling.  Handle an empty version from a version script.
	(Symbol_table::define_special_symbol): Likewise.
	* testsuite/ver_test_10.script: New file.
	* testsuite/ver_test_10.sh: New file.
	* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
	(check_DATA): Add ver_test_10.syms.
	(ver_test_10.syms, ver_test_10.so): New target.
	* testsuite/Makefile.in: Rebuild.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 12114 bytes
Desc: Handle empty version tag
URL: <https://sourceware.org/pipermail/binutils/attachments/20080723/7752275c/attachment.bin>


More information about the Binutils mailing list