aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tic54x.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-27 22:50:38 +0930
committerAlan Modra <amodra@gmail.com>2015-08-27 23:19:59 +0930
commit2e57ce7b1422a025a65ad4ef0b1f2f4c214b9eec (patch)
tree88373fbff0acc2f1684da6efa238d2f5332c41aa /gas/config/tc-tic54x.c
parentf5cdf4989e5daff1ca8a500d22cbf2eb0692616e (diff)
downloadfsf-binutils-gdb-2e57ce7b1422a025a65ad4ef0b1f2f4c214b9eec.zip
fsf-binutils-gdb-2e57ce7b1422a025a65ad4ef0b1f2f4c214b9eec.tar.gz
fsf-binutils-gdb-2e57ce7b1422a025a65ad4ef0b1f2f4c214b9eec.tar.bz2
More fallout from "Allow symbol and label names to be enclosed in double quotes"
Some of the TC_START_LABEL implementations need to adjust the end of the symbol, when a colon doesn't mean a label definition. That means they need access to nul_char both the restore the NUL location (it may be a quote rather than a colon) and to store the new nul_char. Others need adjusting to step over a potential trailing quote. PR gas/18581 * config/tc-aarch64.h (TC_START_LABEL): Redefine. * config/tc-arm.c (tc_start_label_without_colon): Delete params. Use input_line_pointer directly. * config/tc-arm.h (TC_START_LABEL): Redefine. (TC_START_LABEL_WITHOUT_COLON): Redefine. (tc_start_label_without_colon): Update prototype. * config/tc-bfin.c (bfin_start_label): Delete ptr param. Check for NUL instead. * config/tc-bfin.h (bfin_start_label): Update prototype. (TC_START_LABEL): Redefine. * config/tc-d30v.h (TC_START_LABEL): Redefine. * config/tc-fr30.c (restore_colon): Rewrite. (fr30_is_colon_insn): Add nul_char param. Return int. Bump i_l_p over quote. Update restore_colon calls. * config/tc-fr30.h (TC_START_LABEL): Redefine. (fr30_is_colon_insn): Update prototype. * config/tc-m32c.c (restore_colon, m32c_is_colon_insn): As above. * config/tc-m32c.h (TC_START_LABEL): Redefine. (m32c_is_colon_insn): Update prototype. * config/tc-m32r.h (TC_START_LABEL): Redefine. * config/tc-mep.h (TC_START_LABEL): Redefine. * config/tc-nds32.h (TC_START_LABEL): Redefine. * config/tc-tic54x.c (tic54x_start_label): Replace params with nul_char and next_char. Step over trailing quote. * config/tc-tic54x.h (TC_START_LABEL_WITHOUT_COLON): Redefine. (tic54x_start_label): Update prototype. * read.c (TC_START_LABEL): Redefine. Update invocation. (TC_START_LABEL_WITHOUT_COLON): Update invocation. * config/tc-nios2.c (s_nios2_set): Save initial input_line_pointer and restore if calling s_set. Don't restore delim again.
Diffstat (limited to 'gas/config/tc-tic54x.c')
-rw-r--r--gas/config/tc-tic54x.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index 2637d10..d8df85d 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -5357,22 +5357,21 @@ tic54x_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
syntax puts the symbol *before* the pseudo (which is kinda like MRI syntax,
I guess, except I've never seen a definition of MRI syntax).
- C is the character that used to be at *REST, which points to the end of the
- label.
-
Don't allow labels to start with '.' */
int
-tic54x_start_label (int c, char *rest)
+tic54x_start_label (int nul_char, int next_char)
{
+ char *rest;
+
/* If within .struct/.union, no auto line labels, please. */
if (current_stag != NULL)
return 0;
/* Disallow labels starting with "." */
- if (c != ':')
+ if (next_char != ':')
{
- char *label = rest;
+ char *label = input_line_pointer;
while (!is_end_of_line[(int) label[-1]])
--label;
@@ -5383,22 +5382,22 @@ tic54x_start_label (int c, char *rest)
}
}
- if (is_end_of_line[(int) c])
+ if (is_end_of_line[(int) next_char])
return 1;
- if (ISSPACE (c))
- while (ISSPACE (c = *++rest))
- ;
- if (c == '.')
- {
- /* Don't let colon () define a label for any of these... */
- return (strncasecmp (rest, ".tag", 4) != 0 || !ISSPACE (rest[4]))
- && (strncasecmp (rest, ".struct", 7) != 0 || !ISSPACE (rest[7]))
- && (strncasecmp (rest, ".union", 6) != 0 || !ISSPACE (rest[6]))
- && (strncasecmp (rest, ".macro", 6) != 0 || !ISSPACE (rest[6]))
- && (strncasecmp (rest, ".set", 4) != 0 || !ISSPACE (rest[4]))
- && (strncasecmp (rest, ".equ", 4) != 0 || !ISSPACE (rest[4]));
- }
+ rest = input_line_pointer;
+ if (nul_char == '"')
+ ++rest;
+ while (ISSPACE (next_char))
+ next_char = *++rest;
+ if (next_char != '.')
+ return 1;
- return 1;
+ /* Don't let colon () define a label for any of these... */
+ return ((strncasecmp (rest, ".tag", 4) != 0 || !ISSPACE (rest[4]))
+ && (strncasecmp (rest, ".struct", 7) != 0 || !ISSPACE (rest[7]))
+ && (strncasecmp (rest, ".union", 6) != 0 || !ISSPACE (rest[6]))
+ && (strncasecmp (rest, ".macro", 6) != 0 || !ISSPACE (rest[6]))
+ && (strncasecmp (rest, ".set", 4) != 0 || !ISSPACE (rest[4]))
+ && (strncasecmp (rest, ".equ", 4) != 0 || !ISSPACE (rest[4])));
}