nm patch

David Marston david at illudium.org.uk
Tue Sep 30 14:33:58 PDT 2003


Quick patch for nm to stop it giving a segmentation fault on ALF files.

D
-- 
David Marston
david at illudium.org.uk
-------------- next part --------------
Index: riscos-aof/nm/nm.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/nm/nm.c,v
retrieving revision 1.3
diff -p -r1.3 nm.c
*** riscos-aof/nm/nm.c	4 Apr 2003 11:28:20 -0000	1.3
--- riscos-aof/nm/nm.c	30 Sep 2003 15:39:28 -0000
*************** decode (const char *aof_file)
*** 389,395 ****
      }
    if (hdr->chunkfileid != 0xc3cbc6c5)
      {
!       fprintf (stderr, "File '%s' is not an AOF file\n", aof_file);
        return -1;
      }
  
--- 389,395 ----
      }
    if (hdr->chunkfileid != 0xc3cbc6c5)
      {
!       fprintf (stderr, "File '%s' is not a chunk file\n", aof_file);
        return -1;
      }
  
*************** decode (const char *aof_file)
*** 411,416 ****
--- 411,419 ----
  	  fprintf (stderr, "Failed reading string table\n");
  	  return -1;
  	}
+     } else {
+       fprintf (stderr, "File '%s' is not an AOF file\n", aof_file);
+       return -1;
      }
  
    /* Find file offset for OBJ_AREA.  */


More information about the gcc mailing list