summaryrefslogtreecommitdiff
path: root/bfd/elf-hppa.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-hppa.h')
-rw-r--r--bfd/elf-hppa.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index 1f79147a88..1e280b71ef 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -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))