This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ieee bfd fix


"ar tv artest.a" from the binutils testsuite fails with a "file truncated"
error for --target=i586-linux --enable-targets=i386-linuxaout,i386-coff
with AS_EMULATION=i386aout.  The following patch allows
bfd_check_format_matches to operate as it should. 

OK to install?


bfd/ChangeLog
	* ieee.c (ieee_archive_p): Return bfd_error_wrong_format on
	a format mismatch rather than an "error" from bfd_read such as
	bfd_error_file_truncated.

Index: ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.6
diff -u -p -r1.6 ieee.c
--- ieee.c	1999/12/10 18:51:35	1.6
+++ ieee.c	2000/03/11 12:14:23
@@ -1336,7 +1336,7 @@ ieee_archive_p (abfd)
   if (this_byte (&(ieee->h)) != Module_Beginning)
     {
       abfd->tdata.ieee_ar_data = save;
-      goto error_return;
+      goto got_wrong_format_error;
     }
 
   next_byte (&(ieee->h));
@@ -1345,7 +1345,7 @@ ieee_archive_p (abfd)
     {
       bfd_release (abfd, ieee);
       abfd->tdata.ieee_ar_data = save;
-      goto error_return;
+      goto got_wrong_format_error;
     }
   /* Throw away the filename */
   read_id (&(ieee->h));
@@ -1448,6 +1448,8 @@ ieee_archive_p (abfd)
 
   return abfd->xvec;
 
+ got_wrong_format_error:
+  bfd_set_error (bfd_error_wrong_format);
  error_return:
   if (elts != NULL)
     free (elts);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]