This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
committing patch to fix ar w/no arguments
- To: binutils at sourceware dot cygnus dot com
- Subject: committing patch to fix ar w/no arguments
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Fri, 11 Aug 2000 11:25:15 -0700
I'll commit this, then, as an obvious fix. Quickly tested on
powerpc-linux.
--
- Geoffrey Keating <geoffk@cygnus.com>
===File ~/patches/cygnus/rs6000-binu-noX.patch==============
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/binutils/ChangeLog,v
retrieving revision 1.195
diff -p -u -u -p -r1.195 ChangeLog
--- ChangeLog 2000/08/08 00:47:04 1.195
+++ ChangeLog 2000/08/11 18:07:20
@@ -1,3 +1,8 @@
+2000-08-11 Geoff Keating <geoffk@cygnus.com>
+
+ * ar.c (main): Don't crash if called with no arguments
+ or only '-X32_64' as an argument.
+
2000-08-05 Jason Eckhardt <jle@cygnus.com>
* readelf.c (elf/i860.h): Include.
Index: ar.c
===================================================================
RCS file: /cvs/src/src/binutils/ar.c,v
retrieving revision 1.17
diff -p -u -u -p -r1.17 ar.c
--- ar.c 2000/07/27 01:39:45 1.17
+++ ar.c 2000/08/11 18:07:23
@@ -437,7 +437,7 @@ main (argc, argv)
of object files in the archive (the 64-bit objects
or the 32-bit objects). GNU ar always looks at all
kinds of objects in an archive. */
- while (strcmp (argv[1], "-X32_64") == 0)
+ while (argc > 1 && strcmp (argv[1], "-X32_64") == 0)
{
argv++;
argc--;
============================================================