/* SPARC-specific support for 64-bit ELF
- Copyright (C) 1993-2019 Free Software Foundation, Inc.
+ Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
bfd_size_type count;
arelent *relents;
- allocated = bfd_malloc (rel_hdr->sh_size);
+ if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0)
+ return FALSE;
+ allocated = _bfd_malloc_and_read (abfd, rel_hdr->sh_size, rel_hdr->sh_size);
if (allocated == NULL)
- goto error_return;
-
- if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size)
- goto error_return;
+ return FALSE;
native_relocs = (bfd_byte *) allocated;