summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-11-11 11:06:34 +0000
committerNick Clifton <nickc@redhat.com>2005-11-11 11:06:34 +0000
commit5badf49926b225c431ba8f7370f4cbd09fe63afd (patch)
tree438d939a1704d2f0495d3b4090ca8b33fb092a02 /binutils
parent6eb4464b9def0bcaeec4726242ddc43f1ef9f21b (diff)
downloadbinutils-redhat-5badf49926b225c431ba8f7370f4cbd09fe63afd.tar.gz
PR 1150
* readelf.c (get_mips_symbol_other): New function. (get_symbol_other): New function. (process_symbol_table): Call get_symbol_other() to get a description of the st_other field if it contains more information than just the visibility. * elfxx-mips.c (mips_elf_calculate_relocation): Ignore an undefined symbol if it is optional. (_bfd_mips_elf_merge_symbol_attribute): Make sure that the optional flag is merged as well as the visibility. * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Prototype. (elf_backend_merge_symbol_attribute): Define. * mips.h (STO_OPTIONAL): Define. (ELF_MIPS_IS_OPTIONAL): Define.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog9
-rw-r--r--binutils/readelf.c45
2 files changed, 54 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e9217a0881..54a7c0f816 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,12 @@
+2005-11-11 Nick Clifton <nickc@redhat.com>
+
+ PR 1150
+ * readelf.c (get_mips_symbol_other): New function.
+ (get_symbol_other): New function.
+ (process_symbol_table): Call get_symbol_other() to get a
+ description of the st_other field if it contains more information
+ than just the visibility.
+
2005-11-07 Steve Ellcey <sje@cup.hp.com>
* configure: Regenerate after modifying bfd/warning.m4.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d076a652dd..3e8eb20ec6 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -6690,6 +6690,41 @@ get_symbol_visibility (unsigned int visibility)
}
static const char *
+get_mips_symbol_other (unsigned int other)
+{
+ switch (other)
+ {
+ case STO_OPTIONAL: return "OPTIONAL";
+ case STO_MIPS16: return "MIPS16";
+ default: return NULL;
+ }
+}
+
+static const char *
+get_symbol_other (unsigned int other)
+{
+ const char * result = NULL;
+ static char buff [32];
+
+ if (other == 0)
+ return "";
+
+ switch (elf_header.e_machine)
+ {
+ case EM_MIPS:
+ result = get_mips_symbol_other (other);
+ default:
+ break;
+ }
+
+ if (result)
+ return result;
+
+ snprintf (buff, sizeof buff, _("<other>: %x"), other);
+ return buff;
+}
+
+static const char *
get_symbol_index_type (unsigned int type)
{
static char buff[32];
@@ -6851,6 +6886,11 @@ process_symbol_table (FILE *file)
printf (" %6s", get_symbol_type (ELF_ST_TYPE (psym->st_info)));
printf (" %6s", get_symbol_binding (ELF_ST_BIND (psym->st_info)));
printf (" %3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other)));
+ /* 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 ^ ELF_ST_VISIBILITY (psym->st_other))
+ printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
printf (" %3.3s ", get_symbol_index_type (psym->st_shndx));
if (VALID_DYNAMIC_NAME (psym->st_name))
print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
@@ -6918,6 +6958,11 @@ process_symbol_table (FILE *file)
printf (" %-7s", get_symbol_type (ELF_ST_TYPE (psym->st_info)));
printf (" %-6s", get_symbol_binding (ELF_ST_BIND (psym->st_info)));
printf (" %-3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other)));
+ /* 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 ^ ELF_ST_VISIBILITY (psym->st_other))
+ printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
printf (" %4s ", get_symbol_index_type (psym->st_shndx));
print_symbol (25, psym->st_name < strtab_size
? strtab + psym->st_name : "<corrupt>");