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


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

Re: gas dumps core


   Date: Tue, 7 May 1996 08:51:03 -0500 (CDT)
   From: Joel Sherrill <joel@merlin.gcs.redstone.army.mil>

   Here is all I know with a test case.

   Snapshot:      gas-960503
   Configuration: m68k-coff

   Test file (Yes it is the one line starting with a "#"):

   # 1 ""

I've checked in this patch to fix this problem.

Ian

Index: config/obj-coff.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/obj-coff.c,v
retrieving revision 1.114
diff -u -r1.114 obj-coff.c
--- obj-coff.c	1996/05/04 01:00:04	1.114
+++ obj-coff.c	1996/05/07 15:21:13
@@ -2726,7 +2726,8 @@
 	{
 	  /* If the filename was too long to fit in the
 	     auxent, put it in the string table */
-	  if (SA_GET_FILE_FNAME_ZEROS (symbolP) == 0)
+	  if (SA_GET_FILE_FNAME_ZEROS (symbolP) == 0
+	      && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0)
 	    {
 	      SA_SET_FILE_FNAME_OFFSET (symbolP, string_byte_count);
 	      string_byte_count += strlen (filename_list_scan->filename) + 1;
@@ -2978,7 +2979,8 @@
 	  where += size;
 	}
       if (S_GET_STORAGE_CLASS (symbolP) == C_FILE
-	  && SA_GET_FILE_FNAME_ZEROS (symbolP) == 0)
+	  && SA_GET_FILE_FNAME_ZEROS (symbolP) == 0
+	  && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0)
 	{
 	  size = strlen (filename_list_scan->filename) + 1;
 	  memcpy (where, filename_list_scan->filename, size);
@@ -3535,7 +3537,7 @@
       f->next = 0;
 
       SA_SET_FILE_FNAME_ZEROS (symbolP, 0);
-      SA_SET_FILE_FNAME_OFFSET (symbolP, 0);
+      SA_SET_FILE_FNAME_OFFSET (symbolP, 1);
 
       if (filename_list_tail) 
 	filename_list_tail->next = f;