Add support for STB_GNU_UNIQUE to libebl.
authorUlrich Drepper <drepper@redhat.com>
Wed, 8 Jul 2009 07:53:24 +0000 (00:53 -0700)
committerUlrich Drepper <drepper@redhat.com>
Wed, 8 Jul 2009 07:53:24 +0000 (00:53 -0700)
NEWS
libebl/ChangeLog
libebl/eblsymbolbindingname.c
libebl/eblsymboltypename.c
libelf/ChangeLog
libelf/elf.h

diff --git a/NEWS b/NEWS
index 2933d35..1b73645 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ libelf: Add elf_getshdrnum alias for elf_getshnum and elf_getshdrstrndx alias
         for elf_getshstrndx and deprecate original names.  Sun screwed up
         their implementation and asked for a solution.
 
+libebl: Add support for STB_GNU_UNIQUE.
+
 readelf: Add -N option, speeds up DWARF printing without address->name lookups.
 
 Version 0.141:
index 83319c7..12e94f4 100644 (file)
@@ -1,3 +1,11 @@
+2009-07-08  Ulrich Drepper  <drepper@redhat.com>
+
+       * eblsymbolbindingname.c (ebl_symbol_binding_name): Handle
+       STB_GNU_UNIQUE.
+
+       * eblsymboltypename.c (ebl_symbol_type_name): Only handle STT_GNU_IFUNC
+       if the binary is marked as being for Linux.
+
 2009-04-01  Roland McGrath  <roland@redhat.com>
 
        * eblsymboltypename.c (ebl_symbol_type_name): Add STT_GNU_IFUNC.
index c4412c9..334a9c3 100644 (file)
@@ -1,5 +1,5 @@
 /* Return symbol binding name.
-   Copyright (C) 2001, 2002 Red Hat, Inc.
+   Copyright (C) 2001, 2002, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -78,8 +78,14 @@ ebl_symbol_binding_name (ebl, binding, buf, len)
        res = stb_names[binding];
       else
        {
+         char *ident;
+
          if (binding >= STB_LOPROC && binding <= STB_HIPROC)
            snprintf (buf, len, "LOPROC+%d", binding - STB_LOPROC);
+         else if (binding == STB_GNU_UNIQUE
+                  && (ident = elf_getident (ebl->elf, NULL)) != NULL
+                  && ident[EI_OSABI] == ELFOSABI_LINUX)
+           return "GNU_UNIQUE";
          else if (binding >= STB_LOOS && binding <= STB_HIOS)
            snprintf (buf, len, "LOOS+%d", binding - STB_LOOS);
          else
index 6aae13e..f2ac622 100644 (file)
@@ -84,9 +84,13 @@ ebl_symbol_type_name (ebl, symbol, buf, len)
        res = stt_names[symbol];
       else
        {
+         char *ident;
+
          if (symbol >= STT_LOPROC && symbol <= STT_HIPROC)
            snprintf (buf, len, "LOPROC+%d", symbol - STT_LOPROC);
-         else if (symbol == STT_GNU_IFUNC)
+         else if (symbol == STT_GNU_IFUNC
+                  && (ident = elf_getident (ebl->elf, NULL)) != NULL
+                  && ident[EI_OSABI] == ELFOSABI_LINUX)
            return "GNU_IFUNC";
          else if (symbol >= STT_LOOS && symbol <= STT_HIOS)
            snprintf (buf, len, "LOOS+%d", symbol - STT_LOOS);
index a0163db..5d8ac8a 100644 (file)
@@ -1,3 +1,7 @@
+2009-07-08  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf.h: Update from glibc.
+
 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
 
        * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
index 8fdf74b..7efdede 100644 (file)
@@ -444,6 +444,7 @@ typedef struct
 #define STB_WEAK       2               /* Weak symbol */
 #define        STB_NUM         3               /* Number of defined types.  */
 #define STB_LOOS       10              /* Start of OS-specific */
+#define STB_GNU_UNIQUE 10              /* Unique symbol.  */
 #define STB_HIOS       12              /* End of OS-specific */
 #define STB_LOPROC     13              /* Start of processor-specific */
 #define STB_HIPROC     15              /* End of processor-specific */