]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf64-alpha.c
_bfd_alloc_and_read
[thirdparty/binutils-gdb.git] / bfd / elf64-alpha.c
index ae4be9f07464051950724a0867d410566b2c1a38..ed18202b71869baedbf7e726fbf0ee6ad5679de1 100644 (file)
@@ -1398,11 +1398,10 @@ elf64_alpha_read_ecoff_info (bfd *abfd, asection *section,
          bfd_set_error (bfd_error_file_too_big);                       \
          goto error_return;                                            \
        }                                                               \
-      debug->ptr = (type) bfd_malloc (amt);                            \
-      if (debug->ptr == NULL)                                          \
+      if (bfd_seek (abfd, symhdr->offset, SEEK_SET) != 0)              \
        goto error_return;                                              \
-      if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0    \
-         || bfd_bread (debug->ptr, amt, abfd) != amt)                  \
+      debug->ptr = (type) _bfd_malloc_and_read (abfd, amt, amt);       \
+      if (debug->ptr == NULL)                                          \
        goto error_return;                                              \
     } while (0)