* elfread.c (elf_symtab_read): Install versioned symbol under
authorTom Tromey <tromey@redhat.com>
Mon, 15 Apr 2013 17:31:17 +0000 (17:31 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 15 Apr 2013 17:31:17 +0000 (17:31 +0000)
unversioned name as well.

gdb/ChangeLog
gdb/elfread.c

index 4e0ac4b..d96ab8b 100644 (file)
@@ -1,5 +1,10 @@
 2013-04-15  Tom Tromey  <tromey@redhat.com>
 
+       * elfread.c (elf_symtab_read): Install versioned symbol under
+       unversioned name as well.
+
+2013-04-15  Tom Tromey  <tromey@redhat.com>
+
        PR c++/11990:
        * c-lang.c (cplus_language_defn): Use gdb_demangle.
        * c-typeprint.c (c_type_print_base): Use gdb_demangle.
index 710e9e5..0ec1786 100644 (file)
@@ -574,6 +574,21 @@ elf_symtab_read (struct objfile *objfile, int type,
              gdbarch_elf_make_msymbol_special (gdbarch, sym, msym);
            }
 
+         /* If we see a default versioned symbol, install it under
+            its version-less name.  */
+         if (msym != NULL)
+           {
+             const char *atsign = strchr (sym->name, '@');
+
+             if (atsign != NULL && atsign[1] == '@' && atsign > sym->name)
+               {
+                 int len = atsign - sym->name;
+
+                 record_minimal_symbol (sym->name, len, 1, symaddr,
+                                        ms_type, sym->section, objfile);
+               }
+           }
+
          /* For @plt symbols, also record a trampoline to the
             destination symbol.  The @plt symbol will be used in
             disassembly, and the trampoline will be used when we are