From 2a67688880dc1a9cbb6308c22ea6e62ff4c51297 Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Tue, 15 May 2007 10:06:03 +0000 Subject: [PATCH] gas/ * app.c (do_scrub_chars): Don't damage \@ pseudo-variables. gas/testsuite/ * gas/arm/backslash-at.d: New. * gas/arm/backslash-at.s: New. --- gas/ChangeLog | 4 ++++ gas/app.c | 9 +++++++++ gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/arm/backslash-at.d | 16 ++++++++++++++++ gas/testsuite/gas/arm/backslash-at.s | 16 ++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 gas/testsuite/gas/arm/backslash-at.d create mode 100644 gas/testsuite/gas/arm/backslash-at.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 2a03e5acb11..85bbe260822 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2007-05-15 Mark Shinwell + + * app.c (do_scrub_chars): Don't damage \@ pseudo-variables. + 2007-05-15 Vincent Riviere PR gas/3041 diff --git a/gas/app.c b/gas/app.c index d2308596dc4..aa180044e7c 100644 --- a/gas/app.c +++ b/gas/app.c @@ -1219,6 +1219,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) if ((symver_state != NULL) && (*symver_state == 0)) goto de_fault; #endif + +#ifdef TC_ARM + /* For the ARM, care is needed not to damage occurrences of \@ + by stripping the @ onwards. Yuck. */ + if (to > tostart && *(to - 1) == '\\') + /* Do not treat the @ as a start-of-comment. */ + goto de_fault; +#endif + #ifdef WARN_COMMENTS if (!found_comment) as_where (&found_comment_file, &found_comment); diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4b4b2dba883..05e191e56fa 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-05-15 Mark Shinwell + + * gas/arm/backslash-at.d: New. + * gas/arm/backslash-at.s: New. + 2007-05-15 Vincent Riviere Nick Clifton diff --git a/gas/testsuite/gas/arm/backslash-at.d b/gas/testsuite/gas/arm/backslash-at.d new file mode 100644 index 00000000000..a51def5577c --- /dev/null +++ b/gas/testsuite/gas/arm/backslash-at.d @@ -0,0 +1,16 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#name: Backslash-at for ARM + +.*: file format .*arm.* + +Disassembly of section .text: +00000000 <.text> 615c .short 0x615c +00000002 e3a00000 mov r0, #0 ; 0x0 +00000006 e3a00000 mov r0, #0 ; 0x0 +0000000a e3a00000 mov r0, #0 ; 0x0 +0000000e e3a00001 mov r0, #1 ; 0x1 +00000012 e3a00001 mov r0, #1 ; 0x1 +00000016 e3a00001 mov r0, #1 ; 0x1 +0000001a e3a00002 mov r0, #2 ; 0x2 +0000001e e3a00002 mov r0, #2 ; 0x2 +00000022 e3a00002 mov r0, #2 ; 0x2 diff --git a/gas/testsuite/gas/arm/backslash-at.s b/gas/testsuite/gas/arm/backslash-at.s new file mode 100644 index 00000000000..4975aea688f --- /dev/null +++ b/gas/testsuite/gas/arm/backslash-at.s @@ -0,0 +1,16 @@ +@ Check that \@ is not destroyed when assembling for the ARM. + +.macro bar + mov r0, #\@ + mov r0, #\@@comment + mov r0, #\@ @comment +.endm + +.byte '\\ +.byte '\a + +foo: + bar + bar + bar + -- 2.30.2