This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] PR binutils/20304: Don't get versioned symbol in disassembler
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Mon, 27 Jun 2016 11:34:26 -0700
- Subject: [PATCH] PR binutils/20304: Don't get versioned symbol in disassembler
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Since disassemble_data only copies and sorts array of asymbol, not array
of elf_symbol_type, call _bfd_elf_get_symbol_version_string only if not
in disassembler.
Any comments?
H.J.
---
PR binutils/20304
* objdump.c (objdump_print_symname): Don't get versioned symbol
in disassembler.
---
binutils/objdump.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 174596e..7e7d480 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -810,8 +810,7 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *inf,
asymbol *sym)
{
char *alloc;
- const char *name, *version_string = NULL;
- bfd_boolean hidden = FALSE;
+ const char *name;
alloc = NULL;
name = bfd_asymbol_name (sym);
@@ -823,23 +822,21 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *inf,
name = alloc;
}
- version_string = bfd_get_symbol_version_string (abfd, sym, &hidden);
-
- if (bfd_is_und_section (bfd_get_section (sym)))
- hidden = TRUE;
-
if (inf != NULL)
- {
- (*inf->fprintf_func) (inf->stream, "%s", name);
- if (version_string && *version_string != '\0')
- (*inf->fprintf_func) (inf->stream, hidden ? "@%s" : "@@%s",
- version_string);
- }
+ (*inf->fprintf_func) (inf->stream, "%s", name);
else
{
+ bfd_boolean hidden = FALSE;
+ const char *version_string
+ = bfd_get_symbol_version_string (abfd, sym, &hidden);
+
printf ("%s", name);
if (version_string && *version_string != '\0')
- printf (hidden ? "@%s" : "@@%s", version_string);
+ {
+ if (bfd_is_und_section (bfd_get_section (sym)))
+ hidden = TRUE;
+ printf (hidden ? "@%s" : "@@%s", version_string);
+ }
}
if (alloc != NULL)
--
2.7.4