From 4dae1ae7485e87401ae69bcc4f399c11a089b0d8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 18 Mar 2002 01:26:57 +0000 Subject: * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. * libbfd.h: Regenerate. * archive.c (coff_write_armap): Pass on failures from bfd_write_bigendian_4byte_int. --- bfd/ChangeLog | 7 +++++++ bfd/archive.c | 6 ++++-- bfd/libbfd.c | 7 +++---- bfd/libbfd.h | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1c396e4..e60d35a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2002-03-18 Alan Modra + + * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. + * libbfd.h: Regenerate. + * archive.c (coff_write_armap): Pass on failures from + bfd_write_bigendian_4byte_int. + 2002-03-14 H.J. Lu * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD diff --git a/bfd/archive.c b/bfd/archive.c index fc2ba45..3547ede 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -2190,7 +2190,8 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) != sizeof (struct ar_hdr)) return false; - bfd_write_bigendian_4byte_int (arch, symbol_count); + if (!bfd_write_bigendian_4byte_int (arch, symbol_count)) + return false; /* Two passes, first write the file offsets for each symbol - remembering that each offset is on a two byte boundary. */ @@ -2207,7 +2208,8 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) while (count < symbol_count && map[count].u.abfd == current) { - bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr); + if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr)) + return false; count++; } /* Add size of this archive entry. */ diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 8560d2f..a397d82 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -593,7 +593,7 @@ INTERNAL_FUNCTION bfd_write_bigendian_4byte_int SYNOPSIS - void bfd_write_bigendian_4byte_int (bfd *, unsigned int); + boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); DESCRIPTION Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big @@ -601,15 +601,14 @@ DESCRIPTION archives. */ -void +boolean bfd_write_bigendian_4byte_int (abfd, i) bfd *abfd; unsigned int i; { bfd_byte buffer[4]; bfd_putb32 ((bfd_vma) i, buffer); - if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) != 4) - abort (); + return bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4; } bfd_vma diff --git a/bfd/libbfd.h b/bfd/libbfd.h index d864b22..e7ba1c5 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -586,7 +586,7 @@ extern boolean _bfd_sh_align_load_span /* And more follows */ -void +boolean bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int)); unsigned int -- cgit v1.1