Various noise

This commit is contained in:
Steve Chamberlain 1991-04-03 22:09:43 +00:00
parent a7fe4c5997
commit 0452b5aacf
1 changed files with 56 additions and 51 deletions

View File

@ -28,6 +28,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* $Id$ /* $Id$
* $Log$ * $Log$
* Revision 1.2 1991/04/03 22:09:43 steve
* Various noise
*
* Revision 1.1.1.1 1991/03/21 21:10:42 gumby
* Back from Intel with Steve
*
* Revision 1.1 1991/03/21 21:10:42 gumby * Revision 1.1 1991/03/21 21:10:42 gumby
* Initial revision * Initial revision
* *
@ -259,7 +265,7 @@ snarf_ar_hdr (abfd)
namelen = 0; namelen = 0;
while (namelen < ar_maxnamelen(abfd) && while (namelen < (unsigned)ar_maxnamelen(abfd) &&
( hdr.ar_name[namelen] != 0 && ( hdr.ar_name[namelen] != 0 &&
hdr.ar_name[namelen] != ' ' && hdr.ar_name[namelen] != ' ' &&
hdr.ar_name[namelen] != ar_padchar(abfd))) { hdr.ar_name[namelen] != ar_padchar(abfd))) {
@ -903,7 +909,7 @@ _bfd_write_archive_contents (arch)
BFD_SEND (arch, _bfd_truncate_arname,(arch, BFD_SEND (arch, _bfd_truncate_arname,(arch,
current->filename, current->filename,
arch_hdr(current))); (char *) arch_hdr(current)));
} }
@ -959,10 +965,12 @@ _bfd_write_archive_contents (arch)
return false; return false;
} }
if (bfd_seek (current, 0L, SEEK_SET) != 0L) goto syserr; if (bfd_seek (current, 0L, SEEK_SET) != 0L) goto syserr;
while (remaining) { while (remaining)
unsigned int amt = ((remaining <= DEFAULT_BUFFERSIZE) ? remaining : {
DEFAULT_BUFFERSIZE); unsigned int amt = DEFAULT_BUFFERSIZE;
if (amt > remaining) {
amt = remaining;
}
if (bfd_read (buffer, amt, 1, current) != amt) goto syserr; if (bfd_read (buffer, amt, 1, current) != amt) goto syserr;
if (bfd_write (buffer, amt, 1, arch) != amt) goto syserr; if (bfd_write (buffer, amt, 1, arch) != amt) goto syserr;
remaining -= amt; remaining -= amt;
@ -1011,19 +1019,15 @@ compute_and_write_armap (arch, elength)
unsigned int src_count; unsigned int src_count;
storage = get_symtab_upper_bound (current); storage = get_symtab_upper_bound (current);
if (storage == 0) { if (storage != 0) {
nosymz:
fprintf (stderr, "%s: Symflags set but there are none?\n",
bfd_get_filename (current));
exit (1);
}
syms = (asymbol **) zalloc (storage); syms = (asymbol **) zalloc (storage);
if (syms == NULL) { if (syms == NULL) {
bfd_error = no_memory; /* FIXME -- memory leak */ bfd_error = no_memory; /* FIXME -- memory leak */
return false; return false;
} }
symcount = bfd_canonicalize_symtab (current, syms); symcount = bfd_canonicalize_symtab (current, syms);
if (symcount == 0) goto nosymz;
/* Now map over all the symbols, picking out the ones we want */ /* Now map over all the symbols, picking out the ones we want */
for (src_count = 0; src_count <symcount; src_count++) { for (src_count = 0; src_count <symcount; src_count++) {
@ -1049,6 +1053,7 @@ compute_and_write_armap (arch, elength)
} }
} }
} }
}
/* OK, now we have collected all the data, let's write them out */ /* OK, now we have collected all the data, let's write them out */
if (!BFD_SEND (arch, write_armap, if (!BFD_SEND (arch, write_armap,
(arch, elength, map, orl_count, stridx))) { (arch, elength, map, orl_count, stridx))) {