PR26330, Malloc size error in objdump
authorAlan Modra <amodra@gmail.com>
Mon, 3 Aug 2020 01:31:27 +0000 (11:01 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Aug 2020 04:37:31 +0000 (14:07 +0930)
commitb5f386d52049067ca081651a460ab4ae85e327d4
treec3e7492c0f10b8c152599fe572e40f88933b0dc2
parentee44c2ac7b3efdfd28c41cd32d7fb935b0582a97
PR26330, Malloc size error in objdump

PR 26330
* elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
size against file size.  Correct LONG_MAX limit check.
(_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
(_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
(_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
* elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
bfd_malloc_and_get_section.
bfd/ChangeLog
bfd/elf.c
bfd/elf64-x86-64.c