]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Correct build programs caused by commit from devel tree.
authorUlrich Drepper <drepper@redhat.com>
Mon, 15 Aug 2005 22:19:26 +0000 (22:19 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 15 Aug 2005 22:19:26 +0000 (22:19 +0000)
elf_begin robustification.

libelf/ChangeLog
libelf/elf_begin.c
libelf/elf_getarsym.c
src/Makefile.am

index 0ef52dc145562455741d55059a34ca124462141d..5c68569ec0ddd73988237084253d84cd46aecfc3 100644 (file)
@@ -1,5 +1,7 @@
 2005-08-15  Ulrich Drepper  <drepper@redhat.com>
 
+       * elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.
+
        * Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
        * libelf.map: Export elf_getaroff.
        * libelf.h: Declare elf_getaroff.
index 56c7a481521ce6cf84fb155b9ca3417c953d3543..c4b335953fbfff955925afb29d0eb52025a0ec1e 100644 (file)
@@ -740,8 +740,9 @@ __libelf_next_arhdr (elf)
     {
       ar_hdr = &elf->state.ar.ar_hdr;
 
-      if (pread (elf->fildes, ar_hdr, sizeof (struct ar_hdr),
-                elf->state.ar.offset)
+      if (TEMP_FAILURE_RETRY (pread (elf->fildes, ar_hdr,
+                                    sizeof (struct ar_hdr),
+                                    elf->state.ar.offset))
          != sizeof (struct ar_hdr))
        {
          /* Something went wrong while reading the file.  */
index 1dafa9ace0cdc4e8e77c20c495771cdf2841c21f..67b2697caa99db4b6a2c459386bf31409fdce7b4 100644 (file)
@@ -22,6 +22,7 @@
 #include <assert.h>
 #include <byteswap.h>
 #include <endian.h>
+#include <errno.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include "libelfP.h"
 
 
+#define pread_retry(fd, buf,  len, off) \
+  TEMP_FAILURE_RETRY (pread (fd, buf, len, off))
+
+
 Elf_Arsym *
 elf_getarsym (elf, ptr)
      Elf *elf;
@@ -69,8 +74,8 @@ elf_getarsym (elf, ptr)
        {
          /* We must read index from the file.  */
          assert (elf->fildes != -1);
-         if (pread (elf->fildes, &elf->state.ar.ar_hdr,
-                    sizeof (struct ar_hdr), elf->start_offset + SARMAG)
+         if (pread_retry (elf->fildes, &elf->state.ar.ar_hdr,
+                          sizeof (struct ar_hdr), elf->start_offset + SARMAG)
              != sizeof (struct ar_hdr))
            {
              /* It is not possible to read the index.  Maybe it does not
@@ -120,8 +125,8 @@ elf_getarsym (elf, ptr)
       uint32_t n;
       if (elf->map_address == NULL)
        {
-         if (pread (elf->fildes, &n, sizeof (n),
-                    elf->start_offset + SARMAG + sizeof (struct ar_hdr))
+         if (pread_retry (elf->fildes, &n, sizeof (n),
+                          elf->start_offset + SARMAG + sizeof (struct ar_hdr))
              != sizeof (n))
            {
              /* Cannot read the number of entries.  */
@@ -179,15 +184,17 @@ elf_getarsym (elf, ptr)
              char *new_str = (char *) (elf->state.ar.ar_sym + n + 1);
 
              /* Now read the data from the file.  */
-             if ((size_t) pread (elf->fildes, file_data,
-                                 n * sizeof (uint32_t), elf->start_offset
-                                 + SARMAG + sizeof (struct ar_hdr)
-                                 + sizeof (uint32_t)) != n * sizeof (uint32_t)
-                 || ((size_t) pread (elf->fildes, new_str,
-                                     index_size - n * sizeof (uint32_t),
-                                     elf->start_offset
-                                     + SARMAG + sizeof (struct ar_hdr)
-                                     + (n + 1) * sizeof (uint32_t))
+             if ((size_t) pread_retry (elf->fildes, file_data,
+                                       n * sizeof (uint32_t),
+                                       elf->start_offset + SARMAG
+                                       + sizeof (struct ar_hdr)
+                                       + sizeof (uint32_t))
+                 != n * sizeof (uint32_t)
+                 || ((size_t) pread_retry (elf->fildes, new_str,
+                                           index_size - n * sizeof (uint32_t),
+                                           elf->start_offset
+                                           + SARMAG + sizeof (struct ar_hdr)
+                                           + (n + 1) * sizeof (uint32_t))
                      != index_size - n * sizeof (uint32_t)))
                {
                  /* We were not able to read the data.  */
index 29a537c2d4a41c976439cc9e5e74ec72e55d9966..234d1b6f631322f01ed78d9fae09a380711be132 100644 (file)
@@ -38,7 +38,7 @@ native_ld = @native_ld@
 base_cpu = @base_cpu@
 
 bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
-              elfcmp objdump ar ranlib
+              elfcmp objdump ranlib
 
 
 ld_dsos = libld_elf_i386_pic.a
@@ -67,7 +67,7 @@ libmudflap = -lmudflap
 endif
 
 if BUILD_STATIC
-libdw = ../libdw/libdw.a
+libdw = ../libdw/libdw.a $(libelf) $(libebl)
 libelf = ../libelf/libelf.a
 else
 libdw = ../libdw/libdw.so
@@ -95,7 +95,6 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
 addr2line_LDADD = $(libdw) $(libmudflap)
 elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl
 objdump_LDADD  = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
-ar_LDADD = $(libelf) $(libmudflap)
 ranlib_LDADD = $(libelf) $(libeu) $(libmudflap)
 
 ldlex.o: ldscript.c