Invalid read in _bfd_elf_get_symbol_version_string
authorAlan Modra <amodra@gmail.com>
Tue, 28 Jun 2016 09:29:33 +0000 (18:59 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 28 Jun 2016 09:39:10 +0000 (19:09 +0930)
PR 20304
* objdump.c (objdump_print_symname): Don't attempt to retrieve
version info from synthetic symbols.

binutils/ChangeLog
binutils/objdump.c

index 4f5e225839441b4135d9b1f507deb045c6968d7a..cfea09b5143d95c478f04619daa4214857206966 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-28  Alan Modra  <amodra@gmail.com>
+
+       PR 20304
+       * objdump.c (objdump_print_symname): Don't attempt to retrieve
+       version info from synthetic symbols.
+
 2016-06-24  Alan Modra  <amodra@gmail.com>
 
        * objcopy.c (find_section_rename): Forward declare.  Remove
index 174596e252b8aa5610aed01015cc7512d129ca45..bf9c5923f17bfe2a6e1a36b8cd36c7a66eb97fc1 100644 (file)
@@ -823,7 +823,8 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *inf,
        name = alloc;
     }
 
-  version_string = bfd_get_symbol_version_string (abfd, sym, &hidden);
+  if ((sym->flags & BSF_SYNTHETIC) == 0)
+    version_string = bfd_get_symbol_version_string (abfd, sym, &hidden);
 
   if (bfd_is_und_section (bfd_get_section (sym)))
     hidden = TRUE;