Use bfd_malloc_and_get_section
authorAlan Modra <amodra@gmail.com>
Sat, 1 Jul 2017 12:28:10 +0000 (21:58 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 1 Jul 2017 23:03:12 +0000 (08:33 +0930)
commitbae7501e87ab614115d9d3213b4dd18d96e604db
treee0b4a01a423eb5d078903002b6a0223e575069cd
parent25c5412713badef8cf779186174200ecd880b329
Use bfd_malloc_and_get_section

It's nicer than xmalloc followed by bfd_get_section_contents, since
xmalloc exits on failure and needs a check that its size_t arg doesn't
lose high bits when converted from bfd_size_type.

PR binutils/21665
* objdump.c (strtab): Make var a bfd_byte*.
(disassemble_section): Don't limit malloc size.  Instead, use
bfd_malloc_and_get_section.
(read_section_stabs): Use bfd_malloc_and_get_section.  Return
bfd_byte*.
(find_stabs_section): Remove now unnecessary cast.
* objcopy.c (copy_object): Use bfd_malloc_and_get_section.  Free
contents on error return.
* nlmconv.c (copy_sections): Use bfd_malloc_and_get_section.
binutils/ChangeLog
binutils/nlmconv.c
binutils/objcopy.c
binutils/objdump.c
This page took 0.046402 seconds and 4 git commands to generate.