]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf-hppa.h
bfd/
[thirdparty/binutils-gdb.git] / bfd / elf-hppa.h
index 1f79147a880e4f92a6dd3ade6333732b2e22b2b5..1e280b71efdfa679269cad69a19b6d7f68b9fd24 100644 (file)
@@ -1042,16 +1042,12 @@ static bfd_boolean elf_hppa_sort_unwind (bfd *abfd)
   if (s != NULL)
     {
       bfd_size_type size;
-      char *contents;
+      bfd_byte *contents;
 
-      size = s->_raw_size;
-      contents = bfd_malloc (size);
-      if (contents == NULL)
-       return FALSE;
-
-      if (! bfd_get_section_contents (abfd, s, contents, (file_ptr) 0, size))
+      if (!bfd_malloc_and_get_section (abfd, s, &contents))
        return FALSE;
 
+      size = s->size;
       qsort (contents, (size_t) (size / 16), 16, hppa_unwind_entry_compare);
 
       if (! bfd_set_section_contents (abfd, s, contents, (file_ptr) 0, size))