diff options
author | Jakub Jelinek <jakub@redhat.com> | 2001-12-18 12:15:35 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2001-12-18 12:15:35 +0000 |
commit | 6b9b879a0267f1d994d3d4fbdcbcc2d6643498df (patch) | |
tree | 2a1339c63dc23a0489e64506aa735f71abf3a2c8 /ld/ldlang.c | |
parent | b667df2e28e04351ea2ee5b6fd32b51d4a302130 (diff) | |
download | gdb-6b9b879a0267f1d994d3d4fbdcbcc2d6643498df.zip gdb-6b9b879a0267f1d994d3d4fbdcbcc2d6643498df.tar.gz gdb-6b9b879a0267f1d994d3d4fbdcbcc2d6643498df.tar.bz2 |
* 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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 9994cf8..afce0fa 100644 --- a/ld/ldlang.c +++ b/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) ; |