X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-rx.c;h=bd08eb47d8aa8d667b82996dc44edcccefe777a1;hb=2bb3687ba8720558082d1575823868286d7916b5;hp=0a9900ff21bf37c59aea3fabd2fc0bb8031a8763;hpb=806470a219e84665a59fc6be632d4ed6a4ad908b;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index 0a9900ff21..bd08eb47d8 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -2066,11 +2066,10 @@ elf32_rx_relax_section (bfd * abfd, bfd_set_error (bfd_error_file_too_big); goto error_return; } - shndx_buf = bfd_malloc (amt); - if (shndx_buf == NULL) + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0) goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (shndx_buf, amt, abfd) != amt) + shndx_buf = _bfd_malloc_and_read (abfd, amt, amt); + if (shndx_buf == NULL) goto error_return; shndx_hdr->contents = shndx_buf; }