Have readelf display extra symbol information at the end of the line.

Resolves: #1479302
This commit is contained in:
Nick Clifton 2017-12-12 16:42:48 +00:00
parent 8260f49e83
commit b8265c46f7
2 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,66 @@
diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c
--- binutils.orig/binutils/readelf.c 2017-12-12 16:24:19.571221194 +0000
+++ binutils-2.29/binutils/readelf.c 2017-12-12 16:27:26.997979803 +0000
@@ -11018,12 +11018,14 @@ print_dynamic_symbol (bfd_vma si, unsign
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
printf (" %-7s", get_symbol_visibility (vis));
+#if 0
/* Check to see if any other bits in the st_other field are set.
Note - displaying this information disrupts the layout of the
table being generated, but for the moment this case is very
rare. */
if (psym->st_other ^ vis)
printf (" [%s] ", get_symbol_other (psym->st_other ^ vis));
+#endif
}
printf (" %3.3s ", get_symbol_index_type (psym->st_shndx));
@@ -11031,6 +11033,15 @@ print_dynamic_symbol (bfd_vma si, unsign
print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
else
printf (_(" <corrupt: %14ld>"), psym->st_name);
+#if 1
+ {
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
+
+ /* Check to see if any other bits in the st_other field are set. */
+ if (psym->st_other ^ vis)
+ printf (" \t[%s]", get_symbol_other (psym->st_other ^ vis));
+ }
+#endif
putchar ('\n');
}
--- binutils.orig/binutils/readelf.c 2017-12-12 16:36:21.806561149 +0000
+++ binutils-2.29.1/binutils/readelf.c 2017-12-12 16:38:17.763168514 +0000
@@ -11548,11 +11548,13 @@ process_symbol_table (FILE * file)
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
printf (" %-7s", get_symbol_visibility (vis));
+#if 0
/* Check to see if any other bits in the st_other field are set.
Note - displaying this information disrupts the layout of the
table being generated, but for the moment this case is very rare. */
if (psym->st_other ^ vis)
printf (" [%s] ", get_symbol_other (psym->st_other ^ vis));
+#endif
}
printf (" %4s ", get_symbol_index_type (psym->st_shndx));
print_symbol (25, psym->st_name < strtab_size
@@ -11571,7 +11573,15 @@ process_symbol_table (FILE * file)
printf (sym_info == symbol_hidden ? "@%s" : "@@%s",
version_string);
}
+#if 1
+ {
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
+ /* Check to see if any other bits in the st_other field are set. */
+ if (psym->st_other ^ vis)
+ printf (" \t[%s] ", get_symbol_other (psym->st_other ^ vis));
+ }
+#endif
putchar ('\n');
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL

View File

@ -54,7 +54,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.29.1
Release: 8%{?dist}
Release: 9%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -142,6 +142,14 @@ Patch10: binutils-2.29-revert-PLT-elision.patch
# Lifetime: Fixed in 2.30.
Patch11: binutils-strip-delete-relocs.patch
# Purpose: Changes readelf so that when it displays extra information about
# a symbol, this information is placed at the end of the line.
# Lifetime: Permanent.
# FIXME: The proper fix would be to update the scripts that are expecting
# a fixed output from readelf. But it seems that some of them are
# no longer being maintained.
Patch12: binutils-readelf-other-sym-info.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -275,6 +283,7 @@ using libelf instead of BFD.
%patch09 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -683,6 +692,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Tue Dec 12 2017 Nick Clifton <nickc@redhat.com> 2.29.1-9
- Have readelf display extra symbol information at the end of the line. (#1479302)
* Mon Dec 11 2017 Nick Clifton <nickc@redhat.com> 2.29.1-8
- Do not enable relro by default for the PowerPC64 architecture. (#1523946)