mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
* libbfd.c (bfd_read): Set bfd_error as appropriate for a short
read. (bfd_error_system_call or bfd_error_file_truncated). * som.c: Do not blindly set bfd_error_system_call after a failing bfd_read, bfd_write, or bfd_seek. In a few places (like som_object_p) override the error status set by bfd_read. * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise. * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise. * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise. * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise. * som.c: Check return values from several bfd_{seek,read,write} calls that we just assumed were not failing.
This commit is contained in:
13
bfd/ecoff.c
13
bfd/ecoff.c
@ -646,10 +646,7 @@ ecoff_slurp_symbolic_header (abfd)
|
||||
if (bfd_seek (abfd, ecoff_data (abfd)->sym_filepos, SEEK_SET) == -1
|
||||
|| (bfd_read (raw, external_hdr_size, 1, abfd)
|
||||
!= external_hdr_size))
|
||||
{
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
goto error_return;
|
||||
}
|
||||
goto error_return;
|
||||
internal_symhdr = &ecoff_data (abfd)->debug_info.symbolic_header;
|
||||
(*backend->debug_swap.swap_hdr_in) (abfd, raw, internal_symhdr);
|
||||
|
||||
@ -755,7 +752,6 @@ ecoff_slurp_symbolic_info (abfd)
|
||||
SEEK_SET) != 0
|
||||
|| bfd_read (raw, raw_size, 1, abfd) != raw_size)
|
||||
{
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
bfd_release (abfd, raw);
|
||||
return false;
|
||||
}
|
||||
@ -1831,10 +1827,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols)
|
||||
return false;
|
||||
if (bfd_read (external_relocs, 1, external_relocs_size, abfd)
|
||||
!= external_relocs_size)
|
||||
{
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
for (i = 0, rptr = internal_relocs; i < section->reloc_count; i++, rptr++)
|
||||
{
|
||||
@ -2505,8 +2498,6 @@ ecoff_write_object_contents (abfd)
|
||||
struct internal_aouthdr internal_a;
|
||||
int i;
|
||||
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
|
||||
/* Determine where the sections and relocs will go in the output
|
||||
file. */
|
||||
reloc_size = ecoff_compute_reloc_file_positions (abfd);
|
||||
|
Reference in New Issue
Block a user