This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

[Digital UNIX V4.0] Avoid mips-tdump crashes with DEC C output


On Digital UNIX V4.0, mips-tdump crashes with a SEGV on every binary
created by DEC C (V5.2-038 and V5.6-075).  I could trace this to an
unknown/unspecified file name in the File Descriptor Entry (struct fdr) and
missing local symbols.

The new Object File/Symbol Table Format Specification for Digital UNIX V5.0
proved to be quite useful in providing detailed information about DEC's
ECOFF object file format:

http://www.partner.europe.digital.com/www-swdev/pages/Home/TECH/dunix/ofst/build/src/index.html

The following patch fixes this:

Wed Jan 13 22:05:36 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* mips-tdump.c (print_file_desc): Handle unknown filenames and
	missing local symbols.

Index: mips-tdump.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/mips-tdump.c,v
retrieving revision 1.9
diff -u -p -r1.9 mips-tdump.c
--- mips-tdump.c	1999/01/06 19:48:37	1.9
+++ mips-tdump.c	1999/01/13 20:56:30
@@ -1158,8 +1158,10 @@ print_file_desc (fdp, number)
   aux_base = aux_symbols + fdp->iauxBase;
   used_base = aux_used + (aux_base - aux_symbols);
 
-  printf ("\nFile #%d, \"%s\"\n\n", number, str_base + fdp->rss);
-
+  printf ("\nFile #%d, \"%s\"\n\n",
+	  number,
+	  fdp->rss != issNil ? str_base + fdp->rss : "<unknown>");
+    
   printf ("    Name index  = %-10ld Readin      = %s\n",
 	  (long) fdp->rss, (fdp->fReadin) ? "Yes" : "No");
 
@@ -1293,9 +1295,10 @@ print_file_desc (fdp, number)
       PDR *proc_ptr = &proc_desc[pdi];
       printf ("\n\tProcedure descriptor %d:\n", (pdi - fdp->ipdFirst));
 
-      printf ("\t    Name index   = %-11ld Name          = \"%s\"\n",
-	      (long) l_symbols[proc_ptr->isym + fdp->isymBase].iss,
-	      l_symbols[proc_ptr->isym + fdp->isymBase].iss + str_base);
+      if (l_symbols != 0)
+	printf ("\t    Name index   = %-11ld Name          = \"%s\"\n",
+		(long) l_symbols[proc_ptr->isym + fdp->isymBase].iss,
+		l_symbols[proc_ptr->isym + fdp->isymBase].iss + str_base);
 
       printf ("\t    .mask 0x%08lx,%-9ld .fmask 0x%08lx,%ld\n",
 	      (long) proc_ptr->regmask,


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