* ldgram.y (vers_node): Support anonymous version tags.

* ldlang.c (lang_register_vers_node): Ensure anonymous version
	tag is not defined together with non-anonymous versions.
	* ld.texinfo: Document it.

	* elflink.h (size_dynamic_sections): Skip anonymous version tag.
	(elf_link_assign_sym_version): Don't count anonymous version tag.
This commit is contained in:
Jakub Jelinek
2001-12-18 12:15:35 +00:00
parent b667df2e28
commit 6b9b879a02
6 changed files with 50 additions and 3 deletions

View File

@@ -5031,6 +5031,16 @@ lang_register_vers_node (name, version, deps)
struct bfd_elf_version_tree *t, **pp;
struct bfd_elf_version_expr *e1;
if (name == NULL)
name = "";
if ((name[0] == '\0' && lang_elf_version_info != NULL)
|| (lang_elf_version_info && lang_elf_version_info->name[0] == '\0'))
{
einfo (_("%X%P: anonymous version tag cannot be combined with other version tags\n"));
return;
}
/* Make sure this node has a unique name. */
for (t = lang_elf_version_info; t != NULL; t = t->next)
if (strcmp (t->name, name) == 0)
@@ -5067,8 +5077,13 @@ lang_register_vers_node (name, version, deps)
version->deps = deps;
version->name = name;
++version_index;
version->vernum = version_index;
if (name[0] != '\0')
{
++version_index;
version->vernum = version_index;
}
else
version->vernum = 0;
for (pp = &lang_elf_version_info; *pp != NULL; pp = &(*pp)->next)
;