aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/app.c9
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/backslash-at.d16
-rw-r--r--gas/testsuite/gas/arm/backslash-at.s16
5 files changed, 50 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2a03e5a..85bbe26 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-15 Mark Shinwell <shinwell@codesourcery.com>
+
+ * app.c (do_scrub_chars): Don't damage \@ pseudo-variables.
+
2007-05-15 Vincent Riviere <vincent.riviere@freesbee.fr>
PR gas/3041
diff --git a/gas/app.c b/gas/app.c
index d230859..aa18004 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 4b4b2db..05e191e 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-15 Mark Shinwell <shinwell@codesourcery.com>
+
+ * gas/arm/backslash-at.d: New.
+ * gas/arm/backslash-at.s: New.
+
2007-05-15 Vincent Riviere <vincent.riviere@freesbee.fr>
Nick Clifton <nickc@redhat.com>
diff --git a/gas/testsuite/gas/arm/backslash-at.d b/gas/testsuite/gas/arm/backslash-at.d
new file mode 100644
index 0000000..a51def5
--- /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 <foo> e3a00000 mov r0, #0 ; 0x0
+00000006 <foo\+0x4> e3a00000 mov r0, #0 ; 0x0
+0000000a <foo\+0x8> e3a00000 mov r0, #0 ; 0x0
+0000000e <foo\+0xc> e3a00001 mov r0, #1 ; 0x1
+00000012 <foo\+0x10> e3a00001 mov r0, #1 ; 0x1
+00000016 <foo\+0x14> e3a00001 mov r0, #1 ; 0x1
+0000001a <foo\+0x18> e3a00002 mov r0, #2 ; 0x2
+0000001e <foo\+0x1c> e3a00002 mov r0, #2 ; 0x2
+00000022 <foo\+0x20> 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 0000000..4975aea
--- /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
+