[v3,1/9] gas: have scrubber also respect quoted labels
Commit Message
For the handling of ':' elsewhere in the scrubber to be correct with
regard to labels, the state after parsing a string found at the start of
a line must match that after finding a symbol character at the start of
a line. (Things are largely okay when there's whitespace ahead of the
label: Whitespace after the colon then is retained rather than dropped
for typical targets like x86, but read.c will know to deal with that.)
---
v3: New.
@@ -1113,6 +1113,8 @@ do_scrub_chars (size_t (*get) (char *, s
}
else if (state == 3)
old_state = 9;
+ else if (state == 0)
+ old_state = 11; /* Now seeing label definition. */
else
old_state = state;
state = 5;
@@ -477,6 +477,7 @@ if [is_elf_format] {
}
run_dump_test quoted-sym-names
+run_dump_test quoted-label-blank
# Targets where # is not a line comment character don't transform
# "# <line> <file>" into .linefile (PR gas/29120).
@@ -0,0 +1,9 @@
+#nm: --extern-only --numeric-sort
+#name: quoted label name followed by whitespace
+# No quoted strings handling (TC_STRING_ESCAPES set to 0):
+#notarget: powerpc*-*-aix* powerpc*-*-beos* powerpc-*-macos* rs6000-*-*
+# Certain LABELS_WITHOUT_COLONS targets:
+#notarget: mmix-*-* tic54*-*-* z80-*-*
+
+#...
+0+00 D blank-after
@@ -0,0 +1,4 @@
+ .data
+ .globl "blank-after"
+"blank-after" :
+ .byte 0