]> git.pld-linux.org Git - packages/crossppc-binutils.git/blobdiff - binutils-gasp.patch
- updated for 2.17.50.0.2
[packages/crossppc-binutils.git] / binutils-gasp.patch
index d8d387c520e7dc7097311844481fc58b9254a33f..5e2ef091ee36ab04e8fff3f14d7cfead42d6ed22 100644 (file)
@@ -1,7 +1,7 @@
-diff -Nur binutils-2.13.90.0.18.orig/gas/Makefile.am binutils-2.13.90.0.18/gas/Makefile.am
---- binutils-2.13.90.0.18.orig/gas/Makefile.am Sun Feb  2 03:21:17 2003
-+++ binutils-2.13.90.0.18/gas/Makefile.am      Sun Feb  2 12:25:10 2003
-@@ -197,7 +197,7 @@
+diff -urNbB binutils-2.16.91.0.2.org/gas/Makefile.am binutils-2.16.91.0.2/gas/Makefile.am
+--- binutils-2.16.91.0.2.org/gas/Makefile.am   2005-07-20 19:27:27.000000000 +0000
++++ binutils-2.16.91.0.2/gas/Makefile.am       2005-07-21 18:35:02.000000000 +0000
+@@ -204,7 +204,7 @@
        symbols.c \
        write.c
  
@@ -10,7 +10,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/Makefile.am binutils-2.13.90.0.18/gas/M
  
  HFILES = \
        as.h \
-@@ -452,7 +452,8 @@
+@@ -466,7 +466,8 @@
  
  # Note: GASP is now deprecated and has been removed.  It is still
  # available in the CVS archive or older binutils releases if it is needed.
@@ -20,7 +20,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/Makefile.am binutils-2.13.90.0.18/gas/M
  noinst_SCRIPTS = $(GDBINIT)
  EXTRA_SCRIPTS = .gdbinit
  
-@@ -515,6 +516,10 @@
+@@ -530,6 +531,10 @@
        as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \
        frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h
  
@@ -28,10 +28,10 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/Makefile.am binutils-2.13.90.0.18/gas/M
 +gasp_new_LDADD = ../libiberty/libiberty.a $(INTLLIBS)
 +gasp_new_DEPENDENCIES = ../libiberty/libiberty.a $(INTLDEPS)
 +
- EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
-           echo $${rootme}/../expect/expect ; \
-           else echo expect ; fi`
-@@ -2416,6 +2421,8 @@
+ EXPECT = expect
+ RUNTEST = runtest
+ RUNTESTFLAGS=
+@@ -2508,6 +2513,8 @@
    $(INCDIR)/obstack.h subsegs.h struc-symbol.h
  write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \
    output-file.h dwarf2dbg.h
@@ -40,89 +40,9 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/Makefile.am binutils-2.13.90.0.18/gas/M
  itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h
  e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \
    emul-target.h
---- binutils-2.14.90.0.7/gas/Makefile.in.orig  2003-10-29 18:37:48.000000000 +0100
-+++ binutils-2.14.90.0.7/gas/Makefile.in       2003-11-04 00:08:05.641363288 +0100
-@@ -365,7 +365,7 @@
-       write.c
--CFILES = $(GAS_CFILES) itbl-ops.c
-+CFILES = $(GAS_CFILES) gasp.c itbl-ops.c
- HFILES = \
-       as.h \
-@@ -631,7 +631,8 @@
- # Note: GASP is now deprecated and has been removed.  It is still
- # available in the CVS archive or older binutils releases if it is needed.
--noinst_PROGRAMS = as-new
-+# ...and it is needed for few packages in distribution.
-+noinst_PROGRAMS = as-new gasp-new
- noinst_SCRIPTS = $(GDBINIT)
- EXTRA_SCRIPTS = .gdbinit
-@@ -678,6 +679,10 @@
-       $(extra_objects) $(GASLIBS) $(INTLDEPS)
-+gasp_new_SOURCES = gasp.c macro.c sb.c hash.c
-+gasp_new_LDADD = ../libiberty/libiberty.a $(INTLLIBS)
-+gasp_new_DEPENDENCIES = ../libiberty/libiberty.a $(INTLDEPS)
-+
- EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
-           echo $${rootme}/../expect/expect ; \
-           else echo expect ; fi`
-@@ -2515,7 +2520,7 @@
- CONFIG_HEADER = config.h
- CONFIG_CLEAN_FILES = gdb.ini .gdbinit po/Makefile.in
- EXTRA_PROGRAMS = itbl-test$(EXEEXT)
--noinst_PROGRAMS = as-new$(EXEEXT)
-+noinst_PROGRAMS = as-new$(EXEEXT) gasp-new$(EXEEXT)
- PROGRAMS = $(noinst_PROGRAMS)
- am__objects_1 = app.$(OBJEXT) as.$(OBJEXT) atof-generic.$(OBJEXT) \
-@@ -2531,6 +2536,10 @@
- am_as_new_OBJECTS = $(am__objects_1)
- as_new_OBJECTS = $(am_as_new_OBJECTS)
- as_new_LDFLAGS =
-+am_gasp_new_OBJECTS = gasp.$(OBJEXT) macro.$(OBJEXT) sb.$(OBJEXT) \
-+      hash.$(OBJEXT)
-+gasp_new_OBJECTS = $(am_gasp_new_OBJECTS)
-+gasp_new_LDFLAGS =
- am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT)
- itbl_test_OBJECTS = $(am_itbl_test_OBJECTS)
- itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o \
-@@ -2562,7 +2571,7 @@
-       install-data-recursive install-exec-recursive \
-       installdirs-recursive install-recursive uninstall-recursive \
-       check-recursive installcheck-recursive
--SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(itbl_test_SOURCES)
-+SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(itbl_test_SOURCES) $(gasp_new_SOURCES)
- all: config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
-@@ -2616,6 +2625,9 @@
- as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES) 
-       @rm -f as-new$(EXEEXT)
-       $(LINK) $(as_new_LDFLAGS) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
-+gasp-new$(EXEEXT): $(gasp_new_OBJECTS) $(gasp_new_DEPENDENCIES)
-+      @rm -f gasp-new$(EXEEXT)
-+      $(LINK) $(gasp_new_LDFLAGS) $(gasp_new_OBJECTS) $(gasp_new_LDADD) $(LIBS)
- itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES) 
-       @rm -f itbl-test$(EXEEXT)
-       $(LINK) $(itbl_test_LDFLAGS) $(itbl_test_OBJECTS) $(itbl_test_LDADD) $(LIBS)
-@@ -3387,6 +3399,8 @@
-   $(INCDIR)/obstack.h subsegs.h struc-symbol.h
- write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \
-   output-file.h dwarf2dbg.h
-+gasp.o: gasp.c $(INCDIR)/getopt.h $(INCDIR)/safe-ctype.h \
-+  sb.h macro.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
- itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h
- e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \
-   emul-target.h
-diff -Nur binutils-2.13.90.0.18.orig/gas/doc/Makefile.am binutils-2.13.90.0.18/gas/doc/Makefile.am
---- binutils-2.13.90.0.18.orig/gas/doc/Makefile.am     Sun Feb  2 03:21:17 2003
-+++ binutils-2.13.90.0.18/gas/doc/Makefile.am  Sun Feb  2 12:35:43 2003
+diff -urNbB binutils-2.16.91.0.2.org/gas/doc/Makefile.am binutils-2.16.91.0.2/gas/doc/Makefile.am
+--- binutils-2.16.91.0.2.org/gas/doc/Makefile.am       2005-07-20 19:27:27.000000000 +0000
++++ binutils-2.16.91.0.2/gas/doc/Makefile.am   2005-07-21 18:31:04.000000000 +0000
 @@ -15,7 +15,7 @@
  
  man_MANS = as.1
@@ -132,34 +52,9 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/doc/Makefile.am binutils-2.13.90.0.18/g
  
  asconfig.texi: $(CONFIG).texi
        rm -f asconfig.texi
---- binutils-2.14.90.0.7/gas/doc/Makefile.in.orig      2003-10-29 18:37:48.000000000 +0100
-+++ binutils-2.14.90.0.7/gas/doc/Makefile.in   2003-11-04 00:08:38.143422224 +0100
-@@ -181,7 +181,7 @@
- man_MANS = as.1
--info_TEXINFOS = as.texinfo 
-+info_TEXINFOS = as.texinfo gasp.texinfo
- CPU_DOCS = \
-       c-a29k.texi \
-@@ -236,11 +236,11 @@
- DIST_SOURCES =
- TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
- am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
--INFO_DEPS = as.info
-+INFO_DEPS = as.info gasp.info
- DVIS = as.dvi
- PDFS = as.pdf
- PSS = as.ps
--TEXINFOS = as.texinfo
-+TEXINFOS = as.texinfo gasp.texinfo
- NROFF = nroff
- MANS = $(man_MANS)
-diff -Nur binutils-2.14.90.0.7.orig/gas/doc/gasp.texinfo binutils-2.14.90.0.7/gas/doc/gasp.texinfo
---- binutils-2.14.90.0.7.orig/gas/doc/gasp.texinfo     Thu Jan  1 01:00:00 1970
-+++ binutils-2.14.90.0.7/gas/doc/gasp.texinfo  Wed Oct 30 05:09:13 2002
+diff -urNbB binutils-2.16.91.0.2.org/gas/doc/gasp.texinfo binutils-2.16.91.0.2/gas/doc/gasp.texinfo
+--- binutils-2.16.91.0.2.org/gas/doc/gasp.texinfo      1970-01-01 00:00:00.000000000 +0000
++++ binutils-2.16.91.0.2/gas/doc/gasp.texinfo  2005-07-21 18:31:04.000000000 +0000
 @@ -0,0 +1,1456 @@
 +\input texinfo               @c             -*- Texinfo -*-
 +@setfilename gasp.info
@@ -1617,10 +1512,9 @@ diff -Nur binutils-2.14.90.0.7.orig/gas/doc/gasp.texinfo binutils-2.14.90.0.7/ga
 +
 +@contents
 +@bye
-diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
---- binutils-2.13.90.0.18.orig/gas/gasp.c      Thu Jan  1 01:00:00 1970
-+++ binutils-2.13.90.0.18/gas/gasp.c   Sun May 26 18:57:12 2002
-@@ -0,0 +1,3761 @@
+--- binutils-2.17.50.0.2/gas/gasp.c.orig       1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.17.50.0.2/gas/gasp.c    2006-06-07 11:22:13.774440000 +0200
+@@ -0,0 +1,3999 @@
 +/* gasp.c - Gnu assembler preprocessor main program.
 +   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
 +   Free Software Foundation, Inc.
@@ -1938,6 +1832,48 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +static void show_usage PARAMS ((FILE *, int));
 +static void show_help PARAMS ((void));
 +
++/* --- functions recently removed from sb.c --- */
++
++/* put a null at the end of the sb at in and return the start of the
++ *    string, so that it can be used as an arg to printf %s.  */
++
++static char *
++sb_name (sb *in)
++{
++  /* stick a null on the end of the string */
++  sb_add_char (in, 0);
++  return in->ptr;
++}
++
++/* print the sb at ptr to the output file */
++
++static void
++sb_print (FILE *outfile, sb *ptr)
++{
++  int i;
++  int nc = 0;
++
++  for (i = 0; i < ptr->len; i++)
++    {
++      if (nc)
++      {
++        fprintf (outfile, ",");
++      }
++      fprintf (outfile, "%d", ptr->ptr[i]);
++      nc = 1;
++    }
++}
++
++/* print the sb at ptr to the output file */
++
++static void
++sb_print_at (FILE *outfile, int idx, sb *ptr)
++{
++  int i;
++  for (i = idx; i < ptr->len; i++)
++    putc (ptr->ptr[i], outfile);
++}
++
 +#define FATAL(x)                              \
 +  do                                          \
 +    {                                         \
@@ -1977,15 +1913,6 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +  else
 +    exitcode = 0;
 +
-+  if (stats)
-+    {
-+      int i;
-+      for (i = 0; i < sb_max_power_two; i++)
-+      {
-+        fprintf (stderr, "strings size %8d : %d\n",
-+                 1 << i, string_count[i]);
-+      }
-+    }
 +  exit (exitcode);
 +}
 +
@@ -4303,7 +4230,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +  const char *err;
 +  int line = linecount ();
 +
-+  err = define_macro (idx, in, &label, get_line, (const char **) NULL);
++  err = define_macro (idx, in, &label, get_line, "[gasp]", line, (const char **) NULL);
 +  if (err != NULL)
 +    ERROR ((stderr, _("macro at line %d: %s\n"), line - 1, err));
 +}
@@ -5382,33 +5309,239 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +  fprintf (stderr, _("\nPlease report this bug.\n"));
 +  exit (1);
 +}
---- binutils-2.14.90.0.8/gas/macro.c.orig      Wed Jan 14 22:07:45 2004
-+++ binutils-2.14.90.0.8/gas/macro.c   Thu Jan 15 10:46:06 2004
-@@ -74,8 +74,8 @@
++
++/* duplicated from as internals */
++
++static void
++identify (char *file)
++{
++  static int identified;
++
++  if (identified)
++    return;
++  identified++;
++
++  if (file)
++    fprintf (stderr, "%s: ", file);
++  fprintf (stderr, _("Assembler messages:\n"));
++}
++
++/* The number of warnings issued.  */
++static int warning_count;
++
++/* The common portion of as_warn and as_warn_where.  */
++
++static void
++as_warn_internal (char *file, unsigned int line, char *buffer)
++{
++  ++warning_count;
++
++  identify (file);
++  if (file)
++    fprintf (stderr, "%s:%u: ", file, line);
++  fprintf (stderr, _("Warning: "));
++  fputs (buffer, stderr);
++  (void) putc ('\n', stderr);
++}
++
++/* Send to stderr a string as a warning, and locate warning
++   in input file(s).
++   Please only use this for when we have some recovery action.
++   Please explain in string (which may have '\n's) what recovery was
++   done.  */
++
++void
++as_warn (const char *format, ...)
++{
++  va_list args;
++  char buffer[2000];
++
++  if (1 /*!flag_no_warnings*/)
++    {
++      va_start (args, format);
++      vsprintf (buffer, format, args);
++      va_end (args);
++      as_warn_internal ((char *) NULL, 0, buffer);
++    }
++}
++
++/* Like as_bad but the file name and line number are passed in.
++   Unfortunately, we have to repeat the function in order to handle
++   the varargs correctly and portably.  */
++
++void
++as_warn_where (char *file, unsigned int line, const char *format, ...)
++{
++  va_list args;
++  char buffer[2000];
++
++  if (1 /*!flag_no_warnings*/)
++    {
++      va_start (args, format);
++      vsprintf (buffer, format, args);
++      va_end (args);
++      as_warn_internal (file, line, buffer);
++    }
++}
++
++/* Nonzero if we've hit a 'bad error', and should not write an obj file,
++   and exit with a nonzero error code.  */
++
++static int error_count;
++
++/* The common portion of as_bad and as_bad_where.  */
++
++static void
++as_bad_internal (char *file, unsigned int line, char *buffer)
++{
++  ++error_count;
++
++  identify (file);
++  if (file)
++    fprintf (stderr, "%s:%u: ", file, line);
++  fprintf (stderr, _("Error: "));
++  fputs (buffer, stderr);
++  (void) putc ('\n', stderr);
++}
++
++/* Send to stderr a string as a warning, and locate warning in input
++   file(s).  Please us when there is no recovery, but we want to
++   continue processing but not produce an object file.
++   Please explain in string (which may have '\n's) what recovery was
++   done.  */
++
++void
++as_bad (const char *format, ...)
++{
++  va_list args;
++  char buffer[2000];
++
++  va_start (args, format);
++  vsprintf (buffer, format, args);
++  va_end (args);
++
++  as_bad_internal ((char *) NULL, 0, buffer);
++}
++
++/* Like as_bad but the file name and line number are passed in.
++   Unfortunately, we have to repeat the function in order to handle
++   the varargs correctly and portably.  */
++
++void
++as_bad_where (char *file, unsigned int line, const char *format, ...)
++{
++  va_list args;
++  char buffer[2000];
++
++  va_start (args, format);
++  vsprintf (buffer, format, args);
++  va_end (args);
++
++  as_bad_internal (file, line, buffer);
++}
++
++/* Indicate assertion failure.
++   Arguments: Filename, line number, optional function name.  */
++
++void
++as_assert (const char *file, int line, const char *fn)
++{
++  fprintf (stderr, _("Internal error!\n"));
++  if (fn)
++    fprintf (stderr, _("Assertion failure in %s at %s line %d.\n"),
++           fn, file, line);
++  else
++    fprintf (stderr, _("Assertion failure at %s line %d.\n"), file, line);
++  fprintf (stderr, _("Please report this bug.\n"));
++  xexit (EXIT_FAILURE);
++}
++
++#ifndef LEX_AT
++/* The m88k unfortunately uses @ as a label beginner.  */
++#define LEX_AT 0
++#endif
++
++#ifndef LEX_BR
++/* The RS/6000 assembler uses {,},[,] as parts of symbol names.  */
++#define LEX_BR 0
++#endif
++
++#ifndef LEX_PCT
++/* The Delta 68k assembler permits % inside label names.  */
++#define LEX_PCT 0
++#endif
++
++#ifndef LEX_QM
++/* The PowerPC Windows NT assemblers permits ? inside label names.  */
++#define LEX_QM 0
++#endif
++
++#ifndef LEX_HASH
++/* The IA-64 assembler uses # as a suffix designating a symbol.  We include
++   it in the symbol and strip it out in tc_canonicalize_symbol_name.  */
++#define LEX_HASH 0
++#endif
++
++#ifndef LEX_DOLLAR
++/* The a29k assembler does not permits labels to start with $.  */
++#define LEX_DOLLAR 3
++#endif
++
++#ifndef LEX_TILDE
++/* The Delta 68k assembler permits ~ at start of label names.  */
++#define LEX_TILDE 0
++#endif
++
++/* Used by is_... macros. our ctype[].  */
++char lex_type[256] = {
++  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     /* @ABCDEFGHIJKLMNO */
++  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     /* PQRSTUVWXYZ[\]^_ */
++  0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
++  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, LEX_QM,        /* 0123456789:;<=>? */
++  LEX_AT, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,        /* @ABCDEFGHIJKLMNO */
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, 0, 3, /* PQRSTUVWXYZ[\]^_ */
++  0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,     /* `abcdefghijklmno */
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, LEX_TILDE, 0, /* pqrstuvwxyz{|}~.  */
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
++  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
++};
++
++/* just a stub to satisfy unused function in sb.o */
++int do_scrub_chars (int (*get) (char*, int), char *tostart, int tolen) {}
+diff -urNbB binutils-2.16.91.0.2.org/gas/macro.c binutils-2.16.91.0.2/gas/macro.c
+--- binutils-2.16.91.0.2.org/gas/macro.c       2005-05-10 22:46:44.000000000 +0000
++++ binutils-2.16.91.0.2/gas/macro.c   2005-07-21 18:31:04.000000000 +0000
+@@ -77,8 +77,8 @@
  static int get_apost_token (int, sb *, sb *, int);
  static int sub_actual (int, sb *, sb *, struct hash_control *, int, sb *, int);
  static const char *macro_expand_body
--  (sb *, sb *, formal_entry *, struct hash_control *, int);
+-  (sb *, sb *, formal_entry *, struct hash_control *, const macro_entry *);
 -static const char *macro_expand (int, sb *, macro_entry *, sb *);
-+  (sb *, sb *, formal_entry *, struct hash_control *, int, int);
++  (sb *, sb *, formal_entry *, struct hash_control *, const macro_entry *, int);
 +static const char *macro_expand (int, sb *, macro_entry *, sb *, int);
+ static void free_macro(macro_entry *);
  
  #define ISWHITE(x) ((x) == ' ' || (x) == '\t')
-@@ -619,7 +619,7 @@
+@@ -762,7 +762,7 @@
  
  static const char *
  macro_expand_body (sb *in, sb *out, formal_entry *formals,
--                 struct hash_control *formal_hash, int locals)
-+                 struct hash_control *formal_hash, int comment_char, int locals)
+-                 struct hash_control *formal_hash, const macro_entry *macro)
++                 struct hash_control *formal_hash, const macro_entry *macro, int comment_char)
  {
    sb t;
-   int src = 0;
-@@ -649,7 +649,14 @@
+   int src = 0, inquote = 0, macro_line = 0;
+@@ -794,7 +794,14 @@
        else if (in->ptr[src] == '\\')
        {
          src++;
--        if (in->ptr[src] == '(')
+-        if (src < in->len && in->ptr[src] == '(')
 +        if (in->ptr[src] == comment_char && comment_char != '\0')
 +          {
 +            /* This is a comment, just drop the rest of the line.  */
@@ -5416,20 +5549,20 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +                   && in->ptr[src] != '\n')
 +              src++;
 +          }
-+        else if (in->ptr[src] == '(')
++        else if (src < in->len && in->ptr[src] == '(')
            {
              /* Sub in till the next ')' literally.  */
              src++;
-@@ -732,7 +739,7 @@
-             formal_entry *f;
+@@ -875,7 +882,7 @@
+         else
+           {
              src = sb_skip_white (src + 5, in);
 -            while (in->ptr[src] != '\n')
 +            while (in->ptr[src] != '\n' && in->ptr[src] != comment_char)
                {
-                 static int loccnt;
-                 char buf[20];
-@@ -759,6 +766,17 @@
+                 const char *name;
+                 formal_entry *f = new_formal ();
+@@ -911,6 +918,17 @@
                }
            }
        }
@@ -5447,7 +5580,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
        else if (in->ptr[src] == '"'
               || (macro_mri && in->ptr[src] == '\''))
        {
-@@ -841,7 +859,7 @@
+@@ -992,7 +1010,7 @@
     body.  */
  
  static const char *
@@ -5456,7 +5589,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
  {
    sb t;
    formal_entry *ptr;
-@@ -891,7 +909,7 @@
+@@ -1038,7 +1056,7 @@
  
    /* Peel off the actuals and store them away in the hash tables' actuals.  */
    idx = sb_skip_white (idx, in);
@@ -5465,16 +5598,16 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
      {
        int scan;
  
-@@ -993,7 +1011,7 @@
-       sb_add_string (&ptr->actual, buffer);
-     }
+@@ -1167,7 +1185,7 @@
+         sb_add_string (&ptr->actual, buffer);
+       }
  
--  err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, 1);
-+  err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, comment_char, 1);
-   if (err != NULL)
-     return err;
+-      err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, m);
++      err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, m, comment_char);
+     }
  
-@@ -1029,7 +1047,7 @@
+   /* Discard any unnamed formal arguments.  */
+@@ -1200,7 +1218,7 @@
     *EXPAND.  Return 1 if a macro is found, 0 otherwise.  */
  
  int
@@ -5483,7 +5616,7 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
             const char **error, macro_entry **info)
  {
    const char *s;
-@@ -1066,7 +1084,7 @@
+@@ -1235,7 +1253,7 @@
      sb_add_char (&line_sb, *s++);
  
    sb_new (expand);
@@ -5492,16 +5625,16 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
  
    sb_kill (&line_sb);
  
-@@ -1090,7 +1108,7 @@
+@@ -1296,7 +1314,7 @@
     success, or an error message otherwise.  */
  
  const char *
 -expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *))
 +expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *), int comment_char)
  {
-   const char *mn;
    sb sub;
-@@ -1128,10 +1146,10 @@
+   formal_entry f;
+@@ -1329,16 +1347,16 @@
    sb_reset (out);
  
    idx = sb_skip_comma (idx, in);
@@ -5510,11 +5643,9 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
      {
        /* Expand once with a null string.  */
 -      err = macro_expand_body (&sub, out, &f, h, 0);
-+      err = macro_expand_body (&sub, out, &f, h, comment_char, 0);
-       if (err != NULL)
-       return err;
++      err = macro_expand_body (&sub, out, &f, h, 0, comment_char);
      }
-@@ -1139,7 +1157,7 @@
+   else
      {
        if (irpc && in->ptr[idx] == '"')
        ++idx;
@@ -5522,8 +5653,8 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +      while (idx < in->len && in->ptr[idx] != comment_char)
        {
          if (!irpc)
-           idx = get_any_string (idx, in, &f.actual, 1, 0);
-@@ -1150,7 +1168,7 @@
+           idx = get_any_string (idx, in, &f.actual);
+@@ -1349,7 +1367,7 @@
                  int nxt;
  
                  nxt = sb_skip_white (idx + 1, in);
@@ -5532,21 +5663,22 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
                    {
                      idx = nxt;
                      break;
-@@ -1160,7 +1178,7 @@
+@@ -1359,7 +1377,7 @@
              sb_add_char (&f.actual, in->ptr[idx]);
              ++idx;
            }
 -        err = macro_expand_body (&sub, out, &f, h, 0);
-+        err = macro_expand_body (&sub, out, &f, h, comment_char, 0);
++        err = macro_expand_body (&sub, out, &f, h, 0, comment_char);
          if (err != NULL)
-           return err;
+           break;
          if (!irpc)
---- binutils-2.14.90.0.8/gas/macro.h.orig      Wed Jan 14 22:07:45 2004
-+++ binutils-2.14.90.0.8/gas/macro.h   Thu Jan 15 10:43:32 2004
-@@ -76,8 +76,8 @@
+diff -urNbB binutils-2.16.91.0.2.org/gas/macro.h binutils-2.16.91.0.2/gas/macro.h
+--- binutils-2.16.91.0.2.org/gas/macro.h       2005-05-10 22:46:44.000000000 +0000
++++ binutils-2.16.91.0.2/gas/macro.h   2005-07-21 18:31:04.000000000 +0000
+@@ -90,8 +90,8 @@
  extern void macro_mri_mode (int);
  extern const char *define_macro
-   (int, sb *, sb *, int (*) (sb *), const char **);
+   (int, sb *, sb *, int (*) (sb *), char *, unsigned int, const char **);
 -extern int check_macro (const char *, sb *, const char **, macro_entry **);
 +extern int check_macro (const char *, sb *, int, const char **, macro_entry **);
  extern void delete_macro (const char *);
@@ -5554,19 +5686,19 @@ diff -Nur binutils-2.13.90.0.18.orig/gas/gasp.c binutils-2.13.90.0.18/gas/gasp.c
 +extern const char *expand_irp (int, int, sb *, sb *, int (*) (sb *), int);
  
  #endif
-diff -Nur binutils-2.13.90.0.18.orig/gas/read.c binutils-2.13.90.0.18/gas/read.c
---- binutils-2.13.90.0.18.orig/gas/read.c      Sun Feb  2 03:21:18 2003
-+++ binutils-2.13.90.0.18/gas/read.c   Sun Feb  2 15:26:06 2003
-@@ -862,7 +862,7 @@
-                         const char *err;
-                         macro_entry *macro;
+diff -urNbB binutils-2.16.91.0.2.org/gas/read.c binutils-2.16.91.0.2/gas/read.c
+--- binutils-2.16.91.0.2.org/gas/read.c        2005-06-22 20:53:34.000000000 +0000
++++ binutils-2.16.91.0.2/gas/read.c    2005-07-21 18:31:04.000000000 +0000
+@@ -555,7 +555,7 @@
+   const char *err;
+   macro_entry *macro;
  
--                        if (check_macro (s, &out, &err, &macro))
-+                        if (check_macro (s, &out, '\0', &err, &macro))
-                           {
-                             if (err != NULL)
-                               as_bad ("%s", err);
-@@ -1855,7 +1855,7 @@
+-  if (check_macro (line, &out, &err, &macro))
++  if (check_macro (line, &out, '\0', &err, &macro))
+     {
+       if (err != NULL)
+       as_bad ("%s", err);
+@@ -1958,7 +1958,7 @@
  
    sb_new (&out);
  
This page took 0.113392 seconds and 4 git commands to generate.