702-binutils-skip-comments.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
  2. Fixes
  3. localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
  4. when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
  5. Paths adjusted to match crosstool's patcher.
  6. Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
  7. From: Andreas Schwab <schwab at suse dot de>
  8. To: Nathan Sidwell <nathan at codesourcery dot com>
  9. Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
  10. Date: Fri, 23 Apr 2004 22:27:19 +0200
  11. Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
  12. Nathan Sidwell <nathan@codesourcery.com> writes:
  13. > Index: read.c
  14. > ===================================================================
  15. > RCS file: /cvs/src/src/gas/read.c,v
  16. > retrieving revision 1.76
  17. > diff -c -3 -p -r1.76 read.c
  18. > *** read.c 12 Mar 2004 17:48:12 -0000 1.76
  19. > --- read.c 18 Mar 2004 09:56:05 -0000
  20. > *************** read_a_source_file (char *name)
  21. > *** 1053,1059 ****
  22. > #endif
  23. > input_line_pointer--;
  24. > /* Report unknown char as ignored. */
  25. > ! ignore_rest_of_line ();
  26. > }
  27. >
  28. > #ifdef md_after_pass_hook
  29. > --- 1053,1059 ----
  30. > #endif
  31. > input_line_pointer--;
  32. > /* Report unknown char as ignored. */
  33. > ! demand_empty_rest_of_line ();
  34. > }
  35. >
  36. > #ifdef md_after_pass_hook
  37. This means that the unknown character is no longer ignored, despite the
  38. comment. As a side effect a line starting with a line comment character
  39. not followed by APP in NO_APP mode now triggers an error instead of just a
  40. warning, breaking builds of glibc on m68k-linux. Earlier in
  41. read_a_source_file where #APP is handled there is another comment that
  42. claims that unknown comments are ignored, when in fact they aren't (only
  43. the initial line comment character is skipped).
  44. Note that the presence of #APP will mess up the line counters, but
  45. that appears to be difficult to fix.
  46. Andreas.
  47. 2004-04-23 Andreas Schwab <schwab@suse.de>
  48. * read.c (read_a_source_file): Ignore unknown text after line
  49. comment character. Fix misleading comment.
  50. --- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
  51. +++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
  52. @@ -950,10 +950,14 @@ read_a_source_file (char *name)
  53. unsigned int new_length;
  54. char *tmp_buf = 0;
  55. - bump_line_counters ();
  56. s = input_line_pointer;
  57. if (strncmp (s, "APP\n", 4))
  58. - continue; /* We ignore it */
  59. + {
  60. + /* We ignore it */
  61. + ignore_rest_of_line ();
  62. + continue;
  63. + }
  64. + bump_line_counters ();
  65. s += 4;
  66. sb_new (&sbuf);
  67. @@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
  68. continue;
  69. #endif
  70. input_line_pointer--;
  71. - /* Report unknown char as ignored. */
  72. + /* Report unknown char as error. */
  73. demand_empty_rest_of_line ();
  74. }
  75. --
  76. Andreas Schwab, SuSE Labs, schwab@suse.de
  77. SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
  78. Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
  79. "And now for something completely different."