The CRIS port has const char line_separator_chars[] = "@"; Apparently this causes a conflict with the \@ macro invocation number counter, as evident by building and checking for cris-axis-linux-gnu: Running x/src/ld/testsuite/ld-elf/elf.exp ... FAIL: ld-elf/multibss1 with ld.log saying: x/src/ld/testsuite/ld-elf/multibss1.s: Assembler messages: x/src/ld/testsuite/ld-elf/multibss1.s:2: Warning: stray `\' x/src/ld/testsuite/ld-elf/multibss1.s: Assembler messages: x/src/ld/testsuite/ld-elf/multibss1.s:2: Warning: stray `\' I guess the simplest and most obvious route would be to make the \ escape any special meaning of the following char (the line-separatorness of @ for this case and perhaps similarly for comment_chars; haven't tested if there's a similar FAIL for ARM where comment_chars contains @). Note: DLX also has the same line_separator_chars.
(In reply to comment #0) > ...haven't tested if there's a similar > FAIL for ARM where comment_chars contains @. Nope, the test passes there.
Created attachment 2978 [details] Allow escaped end of line characters
Hi Hans-Peter, The problem it seems to me is that we are not allowing escaped end-of-line characters. Please could you try out the uploaded patch which I think will address the problem. I was not sure if we should change the default behaviour for other ports (to allow escaped eol characters) so I left them alone. Cheers Nick PS. The ARM port fixes the related problem with line_comment_chars in another way - a horrible hack in do_scrub_chars().
While I do think tc_allow_escaped_end_of_line is overkill and being overcautious that the canonical escape sequence won't fly, the patch certainly works for me. Thanks for fixing this so very promtly! (I would have got to it sooner or later, probably later. ;) Would you mind if I add a specific gas-testcase for \@ in a section directive and elsewhere? Kinda odd that there wasn't any generic one. (Right, there are target-specific ones: gas/cris/macroat and gas/arm/backslash-at.)
(In reply to comment #4) > gas/cris/macroat Come to think of it, that test shows that the \@ handling in .section is the exception, as TRT already happens elsewhere. Please reconsider doing it always instead of having a tc_allow_escaped_end_of_line. Or rename it tc_allow_escaped_end_of_line_in_pseudos_or_perhaps_just_dot_section. :) BTW, I think @progbits and whatnot in .section is "correctly" handled, i.e. not breaking the line. Oddness galore.
Created attachment 2980 [details] Revised patch to specially target macros
Hi Hans-Peter, > Would you mind if I add a specific gas-testcase for \@ in a section directive > and elsewhere? Please do. > Come to think of it, that test shows that the \@ handling in .section is the > exception, as TRT already happens elsewhere. Actually it was nothing to do with the .section directive. It was all to do with the expansion of the \@ sequence inside the body of a macro. > Please reconsider doing it always I have attached a revised patch which does this. It has no target specific features and it works for both the multibss.s and the macroat.s source files. Please give it a try and let me know if you are happy with it. Cheers Nick
(In reply to comment #7) > Hi Hans-Peter, > > > Would you mind if I add a specific gas-testcase for \@ in a section directive > > and elsewhere? > > Please do. > > > Come to think of it, that test shows that the \@ handling in .section is the > > exception, as TRT already happens elsewhere. > > Actually it was nothing to do with the .section directive. It was all to do > with the expansion of the \@ sequence inside the body of a macro. Of course, being the implied context of this PR, and no proof that enforcing some quoting semantics elsewhere is desired or worthwhile. > I have attached a revised patch > Please give it a try and let me know if you are happy with it. Happy, happy. And so are cris-axis-elf, cris-axis-linux-gnu, arm-linux dlx-elf and mmix-knuth-mmixware regression results FWIW.
Patch checked in along with this changelog entry. gas/ChangeLog PR 6926 * read.c (get_line_sb): Renamed to get_non_macro_line_sb. (_find_end_of_line): Add extra parameter indicating if the line is inside a macro. If it is then do not allow the @ character to be treated as a line separator character. (read_a_source): Update use of _find_end_of_line. (find_end_of_line): Likewise. (s_irp): Update use of get_line_sb. (s_macro): Likewise. (do_repeat): Likewise. (get_line_sb): New function. Like the old version of get_line_sb except that it takes an extra parameter indicating whether the line is inside a macro. (get_macro_line_sb): New function.