[PATCH] fix as segv on alpha when --gdwarf2 is used

Julien LEMOINE speedblue@debian.org
Fri Apr 18 23:47:00 GMT 2003


Fix the segv on alpha when try to assemble test.s
% cat /tmp/test.s
.file 2 "axp.s"
.ent qt_vstart
jsr $26,qt_error
.end qt_vstart
% as --gdwarf2 foo.s
zsh: segmentation fault (core dumped)  as --gdwarf2 foo.s

It also fix compilation of guile-1.6 on alpha.
Full bug report is available at :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=187211

Best Regards.
-- 
Julien LEMOINE / Speedblue

-------------- next part --------------
--- inutils-2.13.90.0.18.orig/gas/dwarf2dbg.c	2003-04-14 23:52:23.000000000 +0200
+++ inutils-2.13.90.0.18/gas/dwarf2dbg.c	2003-04-15 00:54:49.000000000 +0200
@@ -332,7 +332,8 @@
       return last_used;
 
   for (i = 1; i < files_in_use; ++i)
-    if (strcmp (filename, files[i].filename) == 0)
+    if (files && files[i].filename &&
+	strcmp (filename, files[i].filename) == 0)
       return i;
 
   if (i >= files_allocated)
@@ -350,7 +351,12 @@
   files[i].dir = 0;
   files_in_use = i + 1;
   last_used = i;
-
+  
+  if (!files[1].filename)
+    {
+      files[1].filename = xstrdup (filename);
+      files[1].dir = 0;
+    }
   return i;
 }
 


More information about the Binutils mailing list