yann@1: [removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank] yann@1: yann@1: Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html yann@1: Fixes yann@1: localealias.s:544: Error: junk at end of line, first unrecognized character is `,' yann@1: when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3 yann@1: yann@1: Paths adjusted to match crosstool's patcher. yann@1: yann@1: Message-Id: m3n052qw2g.fsf@whitebox.m5r.de yann@1: From: Andreas Schwab yann@1: To: Nathan Sidwell yann@1: Cc: Ian Lance Taylor , binutils at sources dot redhat dot com yann@1: Date: Fri, 23 Apr 2004 22:27:19 +0200 yann@1: Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line yann@1: yann@1: Nathan Sidwell writes: yann@1: yann@1: > Index: read.c yann@1: > =================================================================== yann@1: > RCS file: /cvs/src/src/gas/read.c,v yann@1: > retrieving revision 1.76 yann@1: > diff -c -3 -p -r1.76 read.c yann@1: > *** read.c 12 Mar 2004 17:48:12 -0000 1.76 yann@1: > --- read.c 18 Mar 2004 09:56:05 -0000 yann@1: > *************** read_a_source_file (char *name) yann@1: > *** 1053,1059 **** yann@1: > #endif yann@1: > input_line_pointer--; yann@1: > /* Report unknown char as ignored. */ yann@1: > ! ignore_rest_of_line (); yann@1: > } yann@1: > yann@1: > #ifdef md_after_pass_hook yann@1: > --- 1053,1059 ---- yann@1: > #endif yann@1: > input_line_pointer--; yann@1: > /* Report unknown char as ignored. */ yann@1: > ! demand_empty_rest_of_line (); yann@1: > } yann@1: > yann@1: > #ifdef md_after_pass_hook yann@1: yann@1: This means that the unknown character is no longer ignored, despite the yann@1: comment. As a side effect a line starting with a line comment character yann@1: not followed by APP in NO_APP mode now triggers an error instead of just a yann@1: warning, breaking builds of glibc on m68k-linux. Earlier in yann@1: read_a_source_file where #APP is handled there is another comment that yann@1: claims that unknown comments are ignored, when in fact they aren't (only yann@1: the initial line comment character is skipped). yann@1: yann@1: Note that the presence of #APP will mess up the line counters, but yann@1: that appears to be difficult to fix. yann@1: yann@1: Andreas. yann@1: yann@1: 2004-04-23 Andreas Schwab yann@1: yann@1: * read.c (read_a_source_file): Ignore unknown text after line yann@1: comment character. Fix misleading comment. yann@1: yann@1: --- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200 yann@1: +++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200 yann@1: @@ -950,10 +950,14 @@ read_a_source_file (char *name) yann@1: unsigned int new_length; yann@1: char *tmp_buf = 0; yann@1: yann@1: - bump_line_counters (); yann@1: s = input_line_pointer; yann@1: if (strncmp (s, "APP\n", 4)) yann@1: - continue; /* We ignore it */ yann@1: + { yann@1: + /* We ignore it */ yann@1: + ignore_rest_of_line (); yann@1: + continue; yann@1: + } yann@1: + bump_line_counters (); yann@1: s += 4; yann@1: yann@1: sb_new (&sbuf); yann@1: @@ -1052,7 +1056,7 @@ read_a_source_file (char *name) yann@1: continue; yann@1: #endif yann@1: input_line_pointer--; yann@1: - /* Report unknown char as ignored. */ yann@1: + /* Report unknown char as error. */ yann@1: demand_empty_rest_of_line (); yann@1: } yann@1: yann@1: yann@1: -- yann@1: Andreas Schwab, SuSE Labs, schwab@suse.de yann@1: SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany yann@1: Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 yann@1: "And now for something completely different."