bfd_get_file_size calls
authorAlan Modra <amodra@gmail.com>
Wed, 19 Feb 2020 02:44:05 +0000 (13:14 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 19 Feb 2020 02:44:05 +0000 (13:14 +1030)
commit7c5fa58ea907c46817b915ec8b9b35a180e0e74c
treed5c326c134a432d499251b2e71e0f42b807adc89
parent96d3b80f5498c0aa40099f37f6384f2041df045f
bfd_get_file_size calls

bfd_get_file_size can return 0, meaning the file size is unknown.

* coffgen.c (_bfd_coff_get_external_symbols): Don't call
bfd_get_file_size twice.
(_bfd_coff_read_string_table): Allow for bfd_get_file_size
zero, ie. unknown, return.
* elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
* elfcode.h (elf_swap_shdr_in): Likewise.
(elf_object_p): Don't call bfd_get_file_size twice and correct
file size check.
bfd/ChangeLog
bfd/coffgen.c
bfd/elf-attrs.c
bfd/elfcode.h