mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
* 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:
19
ld/ldlang.c
19
ld/ldlang.c
@@ -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)
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user