]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add aliases for elf_getshnum and elf_getshstrndx.
authorUlrich Drepper <drepper@redhat.com>
Sat, 13 Jun 2009 22:55:42 +0000 (15:55 -0700)
committerUlrich Drepper <drepper@redhat.com>
Sat, 13 Jun 2009 22:55:42 +0000 (15:55 -0700)
Sun in their implementation messed up the semantics of these functions.
To get back to source code compatibility they asked for a solution.
We simply add aliases for the two affected functions, named
elf_getshdrnum and elf_getshdrstrndx.  The semantics remains the
same.  Users of the old interfaces receive a warning for now.  In
future we might make it impossible to link programs which request
the old interfaces (binary compatibility will of course be maintained).

24 files changed:
NEWS
configure.ac
libdwfl/ChangeLog
libdwfl/derelocate.c
libdwfl/dwfl_module_getdwarf.c
libdwfl/relocate.c
libelf/ChangeLog
libelf/Makefile.am
libelf/elf32_checksum.c
libelf/elf32_getshdr.c
libelf/elf_getshdrnum.c [moved from libelf/elf_getshnum.c with 94% similarity]
libelf/elf_getshdrstrndx.c [moved from libelf/elf_getshstrndx.c with 97% similarity]
libelf/libelf.h
libelf/libelf.map
libelf/libelfP.h
src/ChangeLog
src/ld.h
src/ldgeneric.c
src/nm.c
src/objdump.c
src/readelf.c
src/size.c
src/strip.c
src/unstrip.c

diff --git a/NEWS b/NEWS
index c0f60bcafe96572a680c8661072969bac1bdfa1f..e3106f71804280e36f883a7bd49f4d4e1234411a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Version 0.142:
+
+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.
+
 Version 0.141:
 
 libebl: sparc backend fixes;
index 4931530c22f84cb4054e3ab108a4212442375f99..4d7ec1e69f84eba07d6795851543f54f1458dee8 100644 (file)
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software Foundation,
 dnl Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 dnl
-AC_INIT([Red Hat elfutils],[0.141],[http://bugzilla.redhat.com/bugzilla/],
+AC_INIT([Red Hat elfutils],[0.142],[http://bugzilla.redhat.com/bugzilla/],
        [elfutils])
 
 AC_CONFIG_AUX_DIR([config])
index 8f51ca73c3eacd68e1ba5c2605b8fb87e0aa1749..97e888f0c2244b681c5b77022e4417993b279a20 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * derelocate.c: Don't use deprecated libelf functions.
+       * dwfl_module_getdwarf.c: Likewise.
+       * relocate.c: Likewise.
+
 2009-04-23  Ulrich Drepper  <drepper@redhat.com>
 
        * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
index c300f84ba9c774d76dd7ff55714b751ee3fb9962..56ba25af27f3129cb68938500591ed23d5826474 100644 (file)
@@ -94,7 +94,7 @@ cache_sections (Dwfl_Module *mod)
   size_t nrefs = 0;
 
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (mod->main.elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (mod->main.elf, &shstrndx) < 0))
     {
     elf_error:
       __libdwfl_seterrno (DWFL_E_LIBELF);
index 06cb4917cf8fc63a71110e65fc50c0f52fea5c5e..f48fabe740a1ccd9ee0f92264a743f4d2c320fbf 100644 (file)
@@ -148,7 +148,7 @@ static const char *
 find_debuglink (Elf *elf, GElf_Word *crc)
 {
   size_t shstrndx;
-  if (elf_getshstrndx (elf, &shstrndx) < 0)
+  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
     return NULL;
 
   Elf_Scn *scn = NULL;
index 2c0f301081e11c7715e2c95ff552bfd033cf3473..a31fe152a033b75c6e59867bd7d971ad69b828e7 100644 (file)
@@ -72,7 +72,7 @@ __libdwfl_relocate_value (Dwfl_Module *mod, Elf *elf, size_t *shstrndx,
         address and update the section header.  */
 
       if (*shstrndx == SHN_UNDEF
-         && unlikely (elf_getshstrndx (elf, shstrndx) < 0))
+         && unlikely (elf_getshdrstrndx (elf, shstrndx) < 0))
        return DWFL_E_LIBELF;
 
       const char *name = elf_strptr (elf, *shstrndx, refshdr->sh_name);
@@ -582,7 +582,7 @@ __libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile, bool debug)
     return DWFL_E_LIBELF;
 
   size_t d_shstrndx;
-  if (elf_getshstrndx (debugfile, &d_shstrndx) < 0)
+  if (elf_getshdrstrndx (debugfile, &d_shstrndx) < 0)
     return DWFL_E_LIBELF;
 
   RELOC_SYMTAB_CACHE (reloc_symtab);
@@ -626,7 +626,7 @@ __libdwfl_relocate_section (Dwfl_Module *mod, Elf *relocated,
   RELOC_SYMTAB_CACHE (reloc_symtab);
 
   size_t shstrndx;
-  if (elf_getshstrndx (relocated, &shstrndx) < 0)
+  if (elf_getshdrstrndx (relocated, &shstrndx) < 0)
     return DWFL_E_LIBELF;
 
   return (__libdwfl_module_getebl (mod)
index 2fd5381bf725cabe35e816e17d4a891be99aa0b0..a0163db1963c20d979e570dbf5fcfc05922985ee 100644 (file)
@@ -1,3 +1,20 @@
+2009-06-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
+       elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
+       * elf_getshnum.c: Renamed to...
+       * elf_getshdrnum.c: ...this.  Rename function and add old name as
+       alias.  Likewise for internal functions with derived names.
+       * elf_getshstrndx.c: Renamed to...
+       * elf_getshdrstrndx.c: ...this.  Rename function and add old name as
+       alias.  Likewise for internal functions with derived names.
+       * libelf.h: Add prototypes for new names.  Make old names as
+       deprecated.
+       * libelfP.h: Rename internal function prototypes.
+       * libelf.map: Export for names.
+       * elf32_checksum.c: Don't use deprecated functions.
+       * elf32_getshdr.c: Likewise.
+
 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
 
        * elf.h: Update from glibc.
index 84b01a86728c6bde7ebd2b0d6c41b99f79bbbe83..fbb19a63abf3d907ade3a08980d5b3d1bd168f9d 100644 (file)
@@ -91,7 +91,7 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
                   gelf_update_versym.c gelf_update_verneed.c \
                   gelf_update_vernaux.c gelf_update_verdef.c \
                   gelf_update_verdaux.c \
-                  elf_getshnum.c elf_getshstrndx.c \
+                  elf_getshdrnum.c elf_getshdrstrndx.c \
                   gelf_checksum.c elf32_checksum.c elf64_checksum.c \
                   libelf_crc32.c libelf_next_prime.c \
                   elf_clone.c \
index 32b4a02de2c185ef3be38ae80aed4210d0bde8fa..ad040b80fbea67b1318297858d011b08b1038425 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute simple checksum from permanent parts of the ELF file.
-   Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -90,7 +90,7 @@ elfw2(LIBELFBITS,checksum) (elf)
     return -1l;
 
   /* Find the section header string table.  */
-  if  (INTUSE(elf_getshstrndx) (elf, &shstrndx) < 0)
+  if  (INTUSE(elf_getshdrstrndx) (elf, &shstrndx) < 0)
     {
       /* This can only happen if the ELF handle is not for real.  */
       __libelf_seterrno (ELF_E_INVALID_HANDLE);
index 91f5b3a15783085e3a652d444cc5c3d978003ef7..8d650d9f29bd12b3ad75dc65b68d56aa68a87371 100644 (file)
@@ -1,5 +1,5 @@
 /* Return section header.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 1998.
 
@@ -81,7 +81,7 @@ load_shdr_wrlock (Elf_Scn *scn)
     goto out;
 
   size_t shnum;
-  if (__elf_getshnum_rdlock (elf, &shnum) != 0)
+  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
     goto out;
   size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
 
similarity index 94%
rename from libelf/elf_getshnum.c
rename to libelf/elf_getshdrnum.c
index 3c65ef4cf1cab78615f9a0eb2a5a9d316f53426b..ed1149bb20218c400f010f9c9038e887ca41704d 100644 (file)
@@ -1,5 +1,5 @@
 /* Return number of sections in the ELF file.
-   Copyright (C) 2002 Red Hat, Inc.
+   Copyright (C) 2002, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -60,7 +60,7 @@
 
 
 int
-__elf_getshnum_rdlock (elf, dst)
+__elf_getshdrnum_rdlock (elf, dst)
      Elf *elf;
      size_t *dst;
 {
@@ -92,7 +92,7 @@ __elf_getshnum_rdlock (elf, dst)
 }
 
 int
-elf_getshnum (elf, dst)
+elf_getshdrnum (elf, dst)
      Elf *elf;
      size_t *dst;
 {
@@ -102,8 +102,10 @@ elf_getshnum (elf, dst)
     return -1;
 
   rwlock_rdlock (elf->lock);
-  result = __elf_getshnum_rdlock (elf, dst);
+  result = __elf_getshdrnum_rdlock (elf, dst);
   rwlock_unlock (elf->lock);
 
   return result;
 }
+/* Alias for the deprecated name.  */
+strong_alias (elf_getshdrnum, elf_getshnum)
similarity index 97%
rename from libelf/elf_getshstrndx.c
rename to libelf/elf_getshdrstrndx.c
index 52516a8e0355d2f6c8620670d05271784ea782d9..5e89b3430a14399d2b645f921f15f6ac4bb21675 100644 (file)
@@ -1,5 +1,5 @@
 /* Return section index of section header string table.
-   Copyright (C) 2002, 2005 Red Hat, Inc.
+   Copyright (C) 2002, 2005, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -64,7 +64,7 @@
 
 
 int
-elf_getshstrndx (elf, dst)
+elf_getshdrstrndx (elf, dst)
      Elf *elf;
      size_t *dst;
 {
@@ -200,4 +200,6 @@ elf_getshstrndx (elf, dst)
 
   return result;
 }
-INTDEF(elf_getshstrndx)
+INTDEF(elf_getshdrstrndx)
+/* Alias for the deprecated name.  */
+strong_alias (elf_getshdrstrndx, elf_getshstrndx)
index dea0d838e4f317025b0fccb8c8cca0cef5ebb3f6..16c7a7a2e9ef5e69273f9a441d7d31533e0c9fe1 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface for libelf.
-   Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
+   Copyright (C) 1998-2000, 2002, 2004-2007, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -256,14 +256,24 @@ extern int elf_scnshndx (Elf_Scn *__scn);
    sections than can be represented in the e_shnum field of the ELF
    header the information from the sh_size field in the zeroth section
    header is used.  */
-extern int elf_getshnum (Elf *__elf, size_t *__dst);
+extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
+/* Sun messed up the implementation of 'elf_getshnum' in their implementation.
+   It was agreed to make the same functionality available under a different
+   name and obsolete the old name.  */
+extern int elf_getshnum (Elf *__elf, size_t *__dst)
+     __attribute__ ((__deprecated__));
 
 
 /* Get the section index of the section header string table in the ELF
    file.  If the index cannot be represented in the e_shnum field of
    the ELF header the information from the sh_link field in the zeroth
    section header is used.  */
-extern int elf_getshstrndx (Elf *__elf, size_t *__dst);
+extern int elf_getshdrstrndx (Elf *__elf, size_t *__dst);
+/* Sun messed up the implementation of 'elf_getshnum' in their implementation.
+   It was agreed to make the same functionality available under a different
+   name and obsolete the old name.  */
+extern int elf_getshstrndx (Elf *__elf, size_t *__dst)
+     __attribute__ ((__deprecated__));
 
 
 /* Retrieve section header of ELFCLASS32 binary.  */
index c2537774b554c21e9e6f41975f5a762bed146748..e0f40eb89feb241f8673a9ce2ec01edd63560615 100644 (file)
@@ -128,3 +128,8 @@ ELFUTILS_1.4 {
   global:
     elf_scnshndx;
 } ELFUTILS_1.3;
+
+ELFUTILS_1.5 {
+  global:
+    elf_getshdrnum; elf_getshdrstrndx;
+} ELFUTILS_1.4;
index 818f42ac84d21d49902d2153d90569af320a71d9..47d7c2c520d4d9e7747e2a593a9270fbc6afdab3 100644 (file)
@@ -533,11 +533,12 @@ extern Elf32_Phdr *__elf32_newphdr_internal (Elf *__elf, size_t __cnt)
 extern Elf64_Phdr *__elf64_newphdr_internal (Elf *__elf, size_t __cnt)
      attribute_hidden;
 extern Elf_Scn *__elf32_offscn_internal (Elf *__elf, Elf32_Off __offset)
-  attribute_hidden;
+     attribute_hidden;
 extern Elf_Scn *__elf64_offscn_internal (Elf *__elf, Elf64_Off __offset)
-  attribute_hidden;
-extern int __elf_getshnum_rdlock (Elf *__elf, size_t *__dst) internal_function;
-extern int __elf_getshstrndx_internal (Elf *__elf, size_t *__dst)
+     attribute_hidden;
+extern int __elf_getshdrnum_rdlock (Elf *__elf, size_t *__dst)
+     internal_function;
+extern int __elf_getshdrstrndx_internal (Elf *__elf, size_t *__dst)
      attribute_hidden;
 extern Elf32_Shdr *__elf32_getshdr_rdlock (Elf_Scn *__scn) internal_function;
 extern Elf64_Shdr *__elf64_getshdr_rdlock (Elf_Scn *__scn) internal_function;
index 01a2414a02164ad1f8c64dd995189cb9518da418..f74b31d571859c09a172840548730a2632db166b 100644 (file)
@@ -1,3 +1,14 @@
+2009-06-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * ldgeneric.c: Don't use deprecated libelf functions.
+       * nm.c: Likewise.
+       * objdump.c: Likewise.
+       * readelf.c: Likewise.
+       * size.c: Likewise.
+       * strip.c: Likewise.
+       * unstrip.c: Likewise.
+       * ld.h: Fix up comment.
+
 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
 
        * readelf.c (print_relocs): Expect ELF header argument and pass on
index 535f7cd2df74dc5ca088caac3f09fe24baa2c1cd..72d5b27ba615774a4d5a2fc9ed46c0264325281e 100644 (file)
--- a/src/ld.h
+++ b/src/ld.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2005, 2006, 2008 Red Hat, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005, 2006, 2008, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -146,7 +146,7 @@ struct usedfiles
      separate field and not the e_shstrndx field in the ELF header
      since in case of a file with more than 64000 sections the index
      might be stored in the section header of section zero.  The
-     elf_getshstrndx() function can find the value but it is too
+     elf_getshdrstrndx() function can find the value but it is too
      costly to repeat this call over and over.  */
   size_t shstrndx;
 
index 8df2a57e0dbe2b7d6e7373ffc7578e83ffa3b838..b2ea2f906e60ba57546b90f1d14276707651640a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 Red Hat, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -656,7 +656,7 @@ check_definition (const XElf_Sym *sym, size_t shndx, size_t symidx,
       Elf32_Word xndx;
       size_t shnum;
 
-      if (elf_getshnum (fileinfo->elf, &shnum) < 0)
+      if (elf_getshdrnum (fileinfo->elf, &shnum) < 0)
        error (EXIT_FAILURE, 0,
               gettext ("cannot determine number of sections: %s"),
               elf_errmsg (-1));
@@ -1117,7 +1117,7 @@ add_relocatable_file (struct usedfiles *fileinfo, GElf_Word secttype)
   assert (fileinfo->elf != NULL);
 
   /* Allocate memory for the sections.  */
-  if (unlikely (elf_getshnum (fileinfo->elf, &scncnt) < 0))
+  if (unlikely (elf_getshdrnum (fileinfo->elf, &scncnt) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot determine number of sections: %s"),
           elf_errmsg (-1));
@@ -1619,7 +1619,7 @@ add_relocatable_file (struct usedfiles *fileinfo, GElf_Word secttype)
 
 #ifndef NDEBUG
              size_t shnum;
-             assert (elf_getshnum (fileinfo->elf, &shnum) == 0);
+             assert (elf_getshdrnum (fileinfo->elf, &shnum) == 0);
              assert (shndx < shnum);
 #endif
 
@@ -2038,7 +2038,7 @@ file_process2 (struct usedfiles *fileinfo)
            }
 
          /* Determine the section header string table section index.  */
-         if (unlikely (elf_getshstrndx (fileinfo->elf, &fileinfo->shstrndx)
+         if (unlikely (elf_getshdrstrndx (fileinfo->elf, &fileinfo->shstrndx)
                        < 0))
            {
              fprintf (stderr, gettext ("\
@@ -4148,7 +4148,7 @@ compute_hash_sum (void (*hashfct) (const void *, size_t, void *), void *ctx)
 {
   /* The call cannot fail.  */
   size_t shstrndx;
-  (void) elf_getshstrndx (ld_state.outelf, &shstrndx);
+  (void) elf_getshdrstrndx (ld_state.outelf, &shstrndx);
 
   const char *ident = elf_getident (ld_state.outelf, NULL);
   bool same_byte_order = ((ident[EI_DATA] == ELFDATA2LSB
index 8833948a7787afe468f3be69447604f1bb74f0b8..01519a5aef3ca69d8c22ac5df7141546c301d669 100644 (file)
--- a/src/nm.c
+++ b/src/nm.c
@@ -724,7 +724,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx,
                   int longest_where)
 {
   size_t shnum;
-  if (elf_getshnum (ebl->elf, &shnum) < 0)
+  if (elf_getshdrnum (ebl->elf, &shnum) < 0)
     INTERNAL_ERROR (fullname);
 
   bool scnnames_malloced = shnum * sizeof (const char *) > 128 * 1024;
@@ -735,7 +735,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx,
     scnnames = (const char **) alloca (sizeof (const char *) * shnum);
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+  if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -997,7 +997,7 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn,
 {
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+  if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
index af8abf78ac5607d6eae0b2c4d1d34038ffe82742..1234c794ec557cc3649d54508cbf5c74f79c3cb9 100644 (file)
@@ -739,7 +739,7 @@ handle_elf (Elf *elf, const char *prefix, const char *fname,
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+  if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
index 9ce4604240b4fda536c33e36531511e61395a848..ca9772e42c81027d405655b7dd808becbd36c174 100644 (file)
@@ -608,7 +608,7 @@ process_elf_file (Dwfl_Module *dwflmod, int fd)
     }
 
   /* Determine the number of sections.  */
-  if (unlikely (elf_getshnum (ebl->elf, &shnum) < 0))
+  if (unlikely (elf_getshdrnum (ebl->elf, &shnum) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot determine number of sections: %s"),
           elf_errmsg (-1));
@@ -847,7 +847,7 @@ There are %d section headers, starting at offset %#" PRIx64 ":\n\
            ehdr->e_shnum, ehdr->e_shoff);
 
   /* Get the section header string table index.  */
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -990,7 +990,7 @@ print_phdr (Ebl *ebl, GElf_Ehdr *ehdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -1131,7 +1131,7 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -1313,7 +1313,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
     return;
 
   /* Get the section header string table index.  */
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -1511,7 +1511,7 @@ handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -1697,7 +1697,7 @@ handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -1907,7 +1907,7 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2161,7 +2161,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2227,7 +2227,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2305,7 +2305,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2802,7 +2802,7 @@ handle_hash (Ebl *ebl)
 {
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2838,7 +2838,7 @@ print_liblist (Ebl *ebl)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -2900,7 +2900,7 @@ print_attributes (Ebl *ebl, const GElf_Ehdr *ehdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -4687,7 +4687,7 @@ print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
 {
   size_t shstrndx;
   /* We know this call will succeed since it did in the caller.  */
-  (void) elf_getshstrndx (ebl->elf, &shstrndx);
+  (void) elf_getshdrstrndx (ebl->elf, &shstrndx);
   const char *scnname = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
 
   Elf_Data *data = elf_rawdata (scn, NULL);
@@ -6392,7 +6392,7 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -7258,7 +7258,7 @@ handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
     {
       /* Get the section header string table index.  */
       size_t shstrndx;
-      if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+      if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
        error (EXIT_FAILURE, 0,
               gettext ("cannot get section header string table index"));
 
@@ -7403,7 +7403,7 @@ for_each_section_argument (Elf *elf, const struct section_argument *list,
 {
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (elf_getshstrndx (elf, &shstrndx) < 0)
+  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -7472,7 +7472,7 @@ print_strings (Ebl *ebl)
 {
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
index 4698c350fcbb4d8a0c02ad7a79a00b388d1d7568..d3dc1fe543c275be1829925028e52971c714cd07 100644 (file)
@@ -420,7 +420,7 @@ show_sysv (Elf *elf, const char *prefix, const char *fname,
 
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -494,7 +494,7 @@ show_sysv_one_line (Elf *elf)
 {
   /* Get the section header string table index.  */
   size_t shstrndx;
-  if (unlikely (elf_getshstrndx (elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
index d788ebf2f32b1ecd0bb5d2f09b85373dc0c17d4d..32cf0d704e57bd2680197adfbe2c1ff0a946975f 100644 (file)
@@ -477,7 +477,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
     INTERNAL_ERROR (fname);
 
   /* Get the section header string table index.  */
-  if (unlikely (elf_getshstrndx (elf, &shstrndx) < 0))
+  if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
     error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
 
@@ -537,7 +537,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
 
   /* Number of sections.  */
   size_t shnum;
-  if (unlikely (elf_getshnum (elf, &shnum) < 0))
+  if (unlikely (elf_getshdrnum (elf, &shnum) < 0))
     {
       error (0, 0, gettext ("cannot determine number of sections: %s"),
             elf_errmsg (-1));
index 97b73c6f2f125658696b6c757498ed577e62485b..284607b38259eb2beb84dd776eb33fd9be00336a 100644 (file)
@@ -1218,19 +1218,19 @@ copy_elided_sections (Elf *unstripped, Elf *stripped,
                      const GElf_Ehdr *stripped_ehdr, GElf_Addr bias)
 {
   size_t unstripped_shstrndx;
-  ELF_CHECK (elf_getshstrndx (unstripped, &unstripped_shstrndx) == 0,
+  ELF_CHECK (elf_getshdrstrndx (unstripped, &unstripped_shstrndx) == 0,
             _("cannot get section header string table section index: %s"));
 
   size_t stripped_shstrndx;
-  ELF_CHECK (elf_getshstrndx (stripped, &stripped_shstrndx) == 0,
+  ELF_CHECK (elf_getshdrstrndx (stripped, &stripped_shstrndx) == 0,
             _("cannot get section header string table section index: %s"));
 
   size_t unstripped_shnum;
-  ELF_CHECK (elf_getshnum (unstripped, &unstripped_shnum) == 0,
+  ELF_CHECK (elf_getshdrnum (unstripped, &unstripped_shnum) == 0,
             _("cannot get section count: %s"));
 
   size_t stripped_shnum;
-  ELF_CHECK (elf_getshnum (stripped, &stripped_shnum) == 0,
+  ELF_CHECK (elf_getshdrnum (stripped, &stripped_shnum) == 0,
             _("cannot get section count: %s"));
 
   /* Cache the stripped file's section details.  */
@@ -1461,7 +1461,7 @@ copy_elided_sections (Elf *unstripped, Elf *stripped,
                                        strtab);
 
   /* Get the updated section count.  */
-  ELF_CHECK (elf_getshnum (unstripped, &unstripped_shnum) == 0,
+  ELF_CHECK (elf_getshdrnum (unstripped, &unstripped_shnum) == 0,
             _("cannot get section count: %s"));
 
   bool placed[unstripped_shnum - 1];