+2015-08-21 Nick Clifton <nickc@redhat.com>
+
+ PR gas/18581
+ * expr.c (get_symbol_end): Rename to get_symbol_name. Add a
+ return parameter pointing to the start of the symbol. Allow
+ symbol names enclosed in double quotes.
+ (restore_line_pointer): New function. Replace the NUL character
+ inserted into the input stream with the given character. If the
+ character was a double quote, advance the input pointer.
+ * expr.h (get_symbol_end): Delete.
+ (get_symbol_name): Add prototype.
+ (restore_line_pointer): Prototype.
+ * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro.
+ * doc/as.texinfo (Symbol Intro): Document that symbol names can
+ now be enclosed in double quotes.
+ * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name.
+ Use restore_line_pointer to replace the NUL in the input stream.
+ Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol.
+ Check for the use of double quoted symbol names.
+ * expr.c: Likewise.
+ * config/obj-aout.c: Likewise.
+ * config/obj-coff-seh.c: Likewise.
+ * config/obj-coff.c: Likewise.
+ * config/obj-elf.c: Likewise.
+ * config/obj-evax.c: Likewise.
+ * config/obj-macho.c: Likewise.
+ * config/obj-som.c: Likewise.
+ * config/tc-alpha.c: Likewise.
+ * config/tc-arc.c: Likewise.
+ * config/tc-arm.c: Likewise.
+ * config/tc-dlx.c: Likewise.
+ * config/tc-h8300.c: Likewise.
+ * config/tc-hppa.c: Likewise.
+ * config/tc-i370.c: Likewise.
+ * config/tc-i386-intel.c: Likewise.
+ * config/tc-i386.c: Likewise.
+ * config/tc-i960.c: Likewise.
+ * config/tc-ia64.c: Likewise.
+ * config/tc-iq2000.c: Likewise.
+ * config/tc-m32r.c: Likewise.
+ * config/tc-m68hc11.c: Likewise.
+ * config/tc-m68k.c: Likewise.
+ * config/tc-microblaze.c: Likewise.
+ * config/tc-mips.c: Likewise.
+ * config/tc-mmix.c: Likewise.
+ * config/tc-mn10200.c: Likewise.
+ * config/tc-mn10300.c: Likewise.
+ * config/tc-nios2.c: Likewise.
+ * config/tc-ppc.c: Likewise.
+ * config/tc-s390.c: Likewise.
+ * config/tc-score.c: Likewise.
+ * config/tc-score7.c: Likewise.
+ * config/tc-sparc.c: Likewise.
+ * config/tc-tic4x.c: Likewise.
+ * config/tc-tic54x.c: Likewise.
+ * config/tc-tic6x.c: Likewise.
+ * config/tc-tilegx.c: Likewise.
+ * config/tc-tilepro.c: Likewise.
+ * config/tc-v850.c: Likewise.
+ * config/tc-xtensa.c: Likewise.
+ * config/tc-z80.c: Likewise.
+ * dw2gencfi.c: Likewise.
+ * dwarf2dbgc.: Likewise.
+ * ecoff.c: Likewise.
+ * read.c: Likewise.
+ * stabs.c: Likewise.
+
2015-08-19 Jiong Wang <jiong.wang@arm.com>
* config/tc-aarch64.c (reloc_table): New relocation types support for
Changes in 2.26:
+* Symbol and label names can now be enclosed in double quotes (") which allows
+ them to contain characters that are not part of valid symbol names in high
+ level languages.
+
* Added the correctly spelled -march=armv6kz, for ARMv6KZ support. The
previous spelling, -march=armv6zk, is still accepted.
SKIP_WHITESPACE ();
name = input_line_pointer;
- if (!is_name_beginner (*name))
+ if (!is_name_beginner (*name) && *name != '"')
{
as_bad (_("invalid identifier for \".ifdef\""));
obstack_1grow (&cond_obstack, 0);
return;
}
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
symbolP = symbol_find (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
initialize_cframe (&cframe);
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
S_SET_WEAK (symbolP);
if (c == ',')
int c;
symbolS *sym;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{
if (*input_line_pointer == '@')
{
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&symbol_name);
seh_ctx_cur->handler.X_op = O_constant;
seh_ctx_cur->handler.X_add_number = 0;
else
as_bad (_("unknown constant value '%s' for handler"), symbol_name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
}
else
expression (&seh_ctx_cur->handler);
{
do
{
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&symbol_name);
if (strcasecmp (symbol_name, "@unwind") == 0)
seh_ctx_cur->handler_flags |= UNW_FLAG_UHANDLER;
else
as_bad (_(".seh_handler constant '%s' unknown"), symbol_name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
}
while (skip_whitespace_and_comma (0));
}
SKIP_WHITESPACE ();
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&symbol_name);
seh_ctx_cur->func_name = xstrdup (symbol_name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
SKIP_WHITESPACE ();
if (*input_line_pointer == '%')
++input_line_pointer;
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (& symbol_name);
for (i = 0; i < 16; i++)
if (! strcasecmp (regs[i], symbol_name))
break;
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
/* Error if register not found, or EAX used as a frame pointer. */
if (i == 16 || (kind == 0 && i == 0))
SKIP_WHITESPACES ();
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&symbol_name);
symbol_name_length = strlen (symbol_name);
symbol_name_copy = xmalloc (symbol_name_length + 1);
strcpy (symbol_name_copy, symbol_name);
if (S_IS_STRING (def_symbol_in_progress))
SF_SET_STRING (def_symbol_in_progress);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
}
S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
- symbol_name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&symbol_name);
#ifdef tc_canonicalize_symbol_name
symbol_name = tc_canonicalize_symbol_name (symbol_name);
as_warn (_("tag not found for .tag %s"), symbol_name);
SF_SET_TAGGED (def_symbol_in_progress);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
if (is_name_beginner (*input_line_pointer))
{
- char *symbol_name = input_line_pointer;
- char name_end = get_symbol_end ();
+ char *symbol_name;
+ char name_end = get_symbol_name (&symbol_name);
#ifdef tc_canonicalize_symbol_name
- symbol_name = tc_canonicalize_symbol_name (symbol_name);
+ symbol_name = tc_canonicalize_symbol_name (symbol_name);
#endif
if (streq (symbol_name, "."))
{
}
/* Otherwise, it is the name of a non debug symbol and its value
will be calculated later. */
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
}
else
{
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if (*name == 0)
{
as_warn (_("badly formed .weak directive ignored"));
c = 0;
symbolP = symbol_find_or_make (name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
S_SET_WEAK (symbolP);
if (c == ',')
return;
}
- section_name = input_line_pointer;
- c = get_symbol_end ();
-
+ c = get_symbol_name (§ion_name);
name = xmalloc (input_line_pointer - section_name + 1);
strcpy (name, section_name);
-
*input_line_pointer = c;
-
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
exp = 0;
flags = SEC_NO_FLAGS;
char c;
symbolS *sym;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
sym = symbol_find_or_make (name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
/* There is no symbol name if input_line_pointer has not moved. */
if (name == input_line_pointer)
}
else if (c == '@' || c == '%')
{
- beg = ++input_line_pointer;
- c = get_symbol_end ();
- *input_line_pointer = c;
+ ++input_line_pointer;
+ c = get_symbol_name (& beg);
+ (void) restore_line_pointer (c);
type = obj_elf_section_type (beg, input_line_pointer - beg, TRUE);
}
else
ignore_rest_of_line ();
return;
}
- beg = ++input_line_pointer;
- c = get_symbol_end ();
- *input_line_pointer = c;
+ ++input_line_pointer;
+ c = get_symbol_name (& beg);
+ (void) restore_line_pointer (c);
attr |= obj_elf_section_word (beg, input_line_pointer - beg, & type);
++input_line_pointer;
SKIP_WHITESPACE ();
- name = input_line_pointer;
/* Temporarily include '@' in symbol names. */
old_lexat = lex_type[(unsigned char) '@'];
lex_type[(unsigned char) '@'] |= LEX_NAME;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
lex_type[(unsigned char) '@'] = old_lexat;
if (symbol_get_obj (sym)->versioned_name == NULL)
{
symbol_get_obj (sym)->versioned_name = xstrdup (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (strchr (symbol_get_obj (sym)->versioned_name,
ELF_VER_CHR) == NULL)
return;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
demand_empty_rest_of_line ();
if (*input_line_pointer == '#')
++input_line_pointer;
- cname = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& cname);
csym = symbol_find (cname);
/* GCFIXME: should check that we don't have two .vtable_inherits for
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
as_bad (_("expected comma after name in .vtable_inherit"));
}
else
{
- pname = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& pname);
psym = symbol_find_or_make (pname);
- *input_line_pointer = c;
+ restore_line_pointer (c);
}
demand_empty_rest_of_line ();
static void
obj_elf_size (int ignore ATTRIBUTE_UNUSED)
{
- char *name = input_line_pointer;
- char c = get_symbol_end ();
+ char *name;
+ char c = get_symbol_name (&name);
char *p;
expressionS exp;
symbolS *sym;
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
*p = 0;
*input_line_pointer = '\0';
}
else
- *cp = get_symbol_end ();
+ *cp = get_symbol_name (&p);
return p;
}
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
S_SET_WEAK (symbolP);
if (c == ',')
input_line_pointer++; /* Skip ',' */
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
goto done;
}
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer == ',')
input_line_pointer++;
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
obj_mach_o_set_symbol_qualifier (symbolP, ntype);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
c = *input_line_pointer;
if (c == ',')
{
case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
{
obj_mach_o_indirect_sym *isym;
- char *name = input_line_pointer;
- char c = get_symbol_end ();
+ char *name;
+ char c = get_symbol_name (&name);
symbolS *sym = symbol_find_or_make (name);
unsigned int elsize =
bfd_mach_o_section_get_entry_size (stdoutput, sec);
as_bad (_("attempt to add an indirect_symbol to a stub or"
" reference section with a zero-sized element at %s"),
name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
ignore_rest_of_line ();
return;
- }
- *input_line_pointer = c;
+ }
+ (void) restore_line_pointer (c);
/* The indirect symbols are validated after the symbol table is
frozen, we must make sure that if a local symbol is used as an
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
S_SET_WEAK (symbolP);
if (c == ',')
{
++input_line_pointer;
SKIP_WHITESPACE ();
- p = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&p);
/* Parse !relocation_type. */
len = input_line_pointer - p;
}
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != '!')
{
if (r->require_seq)
int log_align = 0;
#endif
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
/* Alpha OSF/1 compiler doesn't provide the comma, gcc does. */
if (*input_line_pointer == ',')
else
{
char *name, name_end;
- name = input_line_pointer;
- name_end = get_symbol_end ();
+
+ name_end = get_symbol_name (&name);
/* CFI_EMIT_eh_frame is the default. */
all_cfi_sections = CFI_EMIT_eh_frame;
if (! is_name_beginner (*name))
{
as_warn (_(".ent directive has no name"));
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
}
else
{
/* The .ent directive is sometimes followed by a number. Not sure
what it really means, but ignore it. */
*input_line_pointer = name_end;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer == ',')
{
input_line_pointer++;
else
{
char *name, name_end;
- name = input_line_pointer;
- name_end = get_symbol_end ();
+
+ name_end = get_symbol_name (&name);
if (! is_name_beginner (*name))
{
as_warn (_(".end directive has no name"));
- *input_line_pointer = name_end;
}
else
{
}
cur_frame_data = NULL;
-
- *input_line_pointer = name_end;
}
+
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
}
symbolS *sym;
int other;
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
if (! is_name_beginner (*name))
{
as_bad (_(".usepv directive has no name"));
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
ignore_rest_of_line ();
return;
}
sym = symbol_find_or_make (name);
- *input_line_pointer++ = name_end;
+ name_end = restore_line_pointer (name_end);
+ if (! is_end_of_line[(unsigned char) name_end])
+ input_line_pointer++;
if (name_end != ',')
{
}
SKIP_WHITESPACE ();
- which = input_line_pointer;
- which_end = get_symbol_end ();
+
+ which_end = get_symbol_name (&which);
if (strcmp (which, "no") == 0)
other = STO_ALPHA_NOPV;
other = 0;
}
- *input_line_pointer = which_end;
+ (void) restore_line_pointer (which_end);
demand_empty_rest_of_line ();
S_SET_OTHER (sym, other | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD));
char c;
SKIP_WHITESPACE ();
- beg = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&beg);
*input_line_pointer = c;
vms_flags |= s_alpha_section_word (beg, input_line_pointer - beg);
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
}
while (*input_line_pointer++ == ',');
+
--input_line_pointer;
}
else
{
char *name, name_end;
- name = input_line_pointer;
- name_end = get_symbol_end ();
+
+ name_end = get_symbol_name (&name);
if (! is_name_beginner (*name))
{
as_warn (_(".handler directive has no name"));
- *input_line_pointer = name_end;
}
else
{
sym = symbol_find_or_make (name);
symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
alpha_evax_proc->handler = sym;
- *input_line_pointer = name_end;
}
- }
+
+ (void) restore_line_pointer (name_end);
+ }
+
demand_empty_rest_of_line ();
}
}
SKIP_WHITESPACE ();
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
if (strncmp (name, "stack", 5) == 0)
alpha_evax_proc->pdsckind = PDSC_S_K_KIND_FP_STACK;
else
{
+ (void) restore_line_pointer (name_end);
as_fatal (_("unknown procedure kind"));
demand_empty_rest_of_line ();
return;
}
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
#ifdef md_flush_pending_output
static void
s_alpha_end (int ignore ATTRIBUTE_UNUSED)
{
+ char *name;
char c;
- c = get_symbol_end ();
- *input_line_pointer = c;
+ c = get_symbol_name (&name);
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
alpha_evax_proc = NULL;
}
/* Takes ".proc name,nargs". */
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
symbolP = symbol_find_or_make (name);
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
*p = 0;
int yesno = 1;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- ch = get_symbol_end ();
+ ch = get_symbol_name (&name);
s = name;
if (s[0] == 'n' && s[1] == 'o')
{
else
as_warn (_("Tried to .set unrecognized mode `%s'"), name);
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
demand_empty_rest_of_line ();
}
const struct cpu_type *p;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- ch = get_symbol_end ();
+
+ ch = get_symbol_name (&name);
for (p = cpu_types; p->name; ++p)
if (strcmp (name, p->name) == 0)
as_warn (_("Unknown CPU identifier `%s'"), name);
found:
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
demand_empty_rest_of_line ();
}
\f
SKIP_WHITESPACE ();
if (*input_line_pointer == '$')
{
- char *s = input_line_pointer;
- char c = get_symbol_end ();
+ char *s;
+ char c = get_symbol_name (&s);
symbolS *sym = md_undefined_symbol (s);
*strchr (s, '\0') = c;
segT old_sec;
int old_subsec;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
name = xstrdup (name);
p = name;
/* just after name is now '\0' */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
segT old_sec;
int old_subsec;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
name = xstrdup (name);
strcpy (syntax, name);
name_len = strlen (name);
/* just after name is now '\0' */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
int align, size;
symbolS *symbolP;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* just after name is now '\0' */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
char c;
char *cpu;
- cpu = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&cpu);
mach = arc_get_mach (cpu);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* If an instruction has already been seen, it's too late. */
if (cpu_tables_init_p)
/* Especial apologies for the random logic:
This just grew, and could be parsed much more simply!
Dean - in haste. */
- name = input_line_pointer;
- delim = get_symbol_end ();
+ delim = get_symbol_name (& name);
end_name = input_line_pointer;
- *end_name = delim;
+ (void) restore_line_pointer (delim);
if (*input_line_pointer != ',')
{
{
char *name, delim;
- name = input_line_pointer;
- delim = get_symbol_end ();
+ delim = get_symbol_name (& name);
if (!strcasecmp (name, "unified"))
unified_syntax = TRUE;
as_bad (_("unrecognized syntax mode \"%s\""), name);
return;
}
- *input_line_pointer = delim;
+ (void) restore_line_pointer (delim);
demand_empty_rest_of_line ();
}
if (unwind.personality_routine || unwind.personality_index != -1)
as_bad (_("duplicate .personality directive"));
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
p = input_line_pointer;
+ if (c == '"')
+ ++ input_line_pointer;
unwind.personality_routine = symbol_find_or_make (name);
*p = c;
demand_empty_rest_of_line ();
return;
}
- name = input_line_pointer;
- delim1 = get_symbol_end ();
+ delim1 = get_symbol_name (&name);
name = xstrdup (name);
*input_line_pointer = delim1;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
{
++input_line_pointer;
SKIP_WHITESPACE ();
- label = input_line_pointer;
- delim2 = get_symbol_end ();
+ delim2 = get_symbol_name (&label);
label = xstrdup (label);
- *input_line_pointer = delim2;
+ (void) restore_line_pointer (delim2);
}
current_name = name;
char *end;
int len;
- /* Cribbed from get_symbol_end. */
+ /* Cribbed from get_symbol_name. */
if (!is_name_beginner (*src) || *src == '\001')
return 0;
end = src + 1;
static void
pa_call_args (struct call_desc *call_desc)
{
- char *name, c, *p;
+ char *name, c;
unsigned int temp, arg_reloc;
while (!is_end_of_statement ())
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Process a source argument. */
if ((strncasecmp (name, "argw", 4) == 0))
{
temp = atoi (name + 4);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
arg_reloc = pa_build_arg_reloc (name);
call_desc->arg_reloc |= pa_align_arg_reloc (temp, arg_reloc);
}
/* Process a return value. */
else if ((strncasecmp (name, "rtnval", 6) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
arg_reloc = pa_build_arg_reloc (name);
call_desc->arg_reloc |= (arg_reloc & 0x3);
}
{
as_bad (_("Invalid .CALL argument: %s"), name);
}
- p = input_line_pointer;
- *p = c;
+
+ (void) restore_line_pointer (c);
if (!is_end_of_statement ())
input_line_pointer++;
}
static void
pa_callinfo (int unused ATTRIBUTE_UNUSED)
{
- char *name, c, *p;
+ char *name, c;
int temp;
#ifdef OBJ_SOM
/* Iterate over the .CALLINFO arguments. */
while (!is_end_of_statement ())
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Frame size specification. */
if ((strncasecmp (name, "frame", 5) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = get_absolute_expression ();
if ((temp & 0x3) != 0)
/* callinfo is in bytes and unwind_desc is in 8 byte units. */
last_call_info->ci_unwind.descriptor.frame_size = temp / 8;
-
}
/* Entry register (GR, GR and SR) specifications. */
else if ((strncasecmp (name, "entry_gr", 8) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = get_absolute_expression ();
/* The HP assembler accepts 19 as the high bound for ENTRY_GR
}
else if ((strncasecmp (name, "entry_fr", 8) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = get_absolute_expression ();
/* Similarly the HP assembler takes 31 as the high bound even
}
else if ((strncasecmp (name, "entry_sr", 8) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = get_absolute_expression ();
if (temp != 3)
as_bad (_("Value for ENTRY_SR must be 3\n"));
}
/* Note whether or not this function performs any calls. */
- else if ((strncasecmp (name, "calls", 5) == 0) ||
- (strncasecmp (name, "caller", 6) == 0))
+ else if ((strncasecmp (name, "calls", 5) == 0)
+ || (strncasecmp (name, "caller", 6) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
}
else if ((strncasecmp (name, "no_calls", 8) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
}
/* Should RP be saved into the stack. */
else if ((strncasecmp (name, "save_rp", 7) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
last_call_info->ci_unwind.descriptor.save_rp = 1;
}
/* Likewise for SP. */
else if ((strncasecmp (name, "save_sp", 7) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
last_call_info->ci_unwind.descriptor.save_sp = 1;
}
/* Is this an unwindable procedure. If so mark it so
in the unwind descriptor. */
else if ((strncasecmp (name, "no_unwind", 9) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
last_call_info->ci_unwind.descriptor.cannot_unwind = 1;
}
/* Is this an interrupt routine. If so mark it in the
unwind descriptor. */
else if ((strncasecmp (name, "hpux_int", 7) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
last_call_info->ci_unwind.descriptor.hpux_interrupt_marker = 1;
}
/* Is this a millicode routine. "millicode" isn't in my
to drop the information, so we'll accept it too. */
else if ((strncasecmp (name, "millicode", 9) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
last_call_info->ci_unwind.descriptor.millicode = 1;
}
else
{
as_bad (_("Invalid .CALLINFO argument: %s"), name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
+
if (!is_end_of_statement ())
input_line_pointer++;
}
static void
pa_type_args (symbolS *symbolP, int is_export)
{
- char *name, c, *p;
+ char *name, c;
unsigned int temp, arg_reloc;
pa_symbol_type type = SYMBOL_TYPE_UNKNOWN;
asymbol *bfdsym = symbol_get_bfdsym (symbolP);
{
if (*input_line_pointer == ',')
input_line_pointer++;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Argument sources. */
if ((strncasecmp (name, "argw", 4) == 0))
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = atoi (name + 4);
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
arg_reloc = pa_align_arg_reloc (temp, pa_build_arg_reloc (name));
#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC)
symbol_arg_reloc_info (symbolP) |= arg_reloc;
#else
(void) arg_reloc;
#endif
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
/* The return value. */
else if ((strncasecmp (name, "rtnval", 6)) == 0)
{
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
arg_reloc = pa_build_arg_reloc (name);
#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC)
symbol_arg_reloc_info (symbolP) |= arg_reloc;
#else
(void) arg_reloc;
#endif
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
/* Privilege level. */
else if ((strncasecmp (name, "priv_lev", 8)) == 0)
{
- p = input_line_pointer;
- *p = c;
+ char *priv;
+
+ (void) restore_line_pointer (c);
input_line_pointer++;
temp = atoi (input_line_pointer);
#ifdef OBJ_SOM
((obj_symbol_type *) bfdsym)->tc_data.ap.hppa_priv_level = temp;
#endif
- c = get_symbol_end ();
- *input_line_pointer = c;
+ c = get_symbol_name (&priv);
+ (void) restore_line_pointer (c);
}
else
{
as_bad (_("Undefined .EXPORT/.IMPORT argument (ignored): %s"), name);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
}
+
if (!is_end_of_statement ())
input_line_pointer++;
}
static void
pa_export (int unused ATTRIBUTE_UNUSED)
{
- char *name, c, *p;
+ char *name, c;
symbolS *symbol;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Make sure the given symbol exists. */
if ((symbol = symbol_find_or_make (name)) == NULL)
{
as_bad (_("Cannot define export symbol: %s\n"), name);
- p = input_line_pointer;
- *p = c;
+ restore_line_pointer (c);
input_line_pointer++;
}
else
set BSF_GLOBAL when we get back. */
S_SET_EXTERNAL (symbol);
symbol_get_bfdsym (symbol)->flags |= BSF_GLOBAL;
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
if (!is_end_of_statement ())
{
input_line_pointer++;
static void
pa_import (int unused ATTRIBUTE_UNUSED)
{
- char *name, c, *p;
+ char *name, c;
symbolS *symbol;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbol = symbol_find (name);
/* Ugh. We might be importing a symbol defined earlier in the file,
if (symbol == NULL || !S_IS_DEFINED (symbol))
{
symbol = symbol_find_or_make (name);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
if (!is_end_of_statement ())
{
static void
pa_label (int unused ATTRIBUTE_UNUSED)
{
- char *name, c, *p;
+ char *name, c;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if (strlen (name) > 0)
{
colon (name);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
}
else
{
static void
pa_param (int unused ATTRIBUTE_UNUSED)
{
- char *name, c, *p;
+ char *name, c;
symbolS *symbol;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if ((symbol = symbol_find_or_make (name)) == NULL)
{
as_bad (_("Cannot define static symbol: %s\n"), name);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
}
else
{
S_CLEAR_EXTERNAL (symbol);
- p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
if (!is_end_of_statement ())
{
input_line_pointer++;
while (!is_end_of_statement ())
{
input_line_pointer++;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if ((strncasecmp (name, "spnum", 5) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
spnum = get_absolute_expression ();
}
else if ((strncasecmp (name, "sort", 4) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
sort = get_absolute_expression ();
}
else if ((strncasecmp (name, "unloadable", 10) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
loadable = FALSE;
}
else if ((strncasecmp (name, "notdefined", 10) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
defined = FALSE;
}
else if ((strncasecmp (name, "private", 7) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
private = TRUE;
}
else
{
as_bad (_("Invalid .SPACE argument"));
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (!is_end_of_statement ())
input_line_pointer++;
}
/* Not a number, attempt to create a new space. */
print_errors = 1;
input_line_pointer = save_s;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
space_name = xmalloc (strlen (name) + 1);
strcpy (space_name, name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
sd_chain = pa_parse_space_stmt (space_name, 1);
current_space = sd_chain;
char *p;
sd_chain_struct *space;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
space = is_defined_space (name);
if (space)
{
else
as_warn (_("Undefined space: '%s' Assuming space number = 0."), name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
}
else
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
ss_name = xmalloc (strlen (name) + 1);
strcpy (ss_name, name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Load default values. */
sort = 0;
input_line_pointer++;
while (!is_end_of_statement ())
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if ((strncasecmp (name, "quad", 4) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
quadrant = get_absolute_expression ();
}
else if ((strncasecmp (name, "align", 5) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
alignment = get_absolute_expression ();
if (exact_log2 (alignment) == -1)
}
else if ((strncasecmp (name, "access", 6) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
access_ctr = get_absolute_expression ();
}
else if ((strncasecmp (name, "sort", 4) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer++;
sort = get_absolute_expression ();
}
else if ((strncasecmp (name, "code_only", 9) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
code_only = 1;
}
else if ((strncasecmp (name, "unloadable", 10) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
loadable = 0;
}
else if ((strncasecmp (name, "comdat", 6) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
comdat = 1;
}
else if ((strncasecmp (name, "common", 6) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
common = 1;
}
else if ((strncasecmp (name, "dup_comm", 8) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
dup_common = 1;
}
else if ((strncasecmp (name, "zero", 4) == 0))
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
zero = 1;
}
else if ((strncasecmp (name, "first", 5) == 0))
as_bad (_("FIRST not supported as a .SUBSPACE argument"));
else
as_bad (_("Invalid .SUBSPACE argument"));
+
if (!is_end_of_statement ())
input_line_pointer++;
}
reg_number = get_single_number ();
else
{
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
/* If numeric, make sure its not out of bounds. */
char *pfrag;
int align2;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
for (j = 0; i386_types[j].name; ++j)
if (strcasecmp (i386_types[j].name, name) == 0)
break;
+
if (i386_types[j].name && *pc == ' ')
{
- char *pname = ++input_line_pointer;
- char c = get_symbol_end ();
+ char *pname;
+ char c;
+
+ ++input_line_pointer;
+ c = get_symbol_name (&pname);
if (strcasecmp (pname, "ptr") == 0)
{
+ /* FIXME: What if c == '"' ? */
pname[-1] = *pc;
*pc = c;
if (intel_syntax > 0 || operands != 1)
return i386_types[j].op;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = pname - 1;
}
SKIP_WHITESPACE ();
if (!is_end_of_line[(unsigned char) *input_line_pointer])
{
- char *string = input_line_pointer;
- int e = get_symbol_end ();
+ char *string;
+ int e = get_symbol_name (&string);
if (strcmp (string, "prefix") == 0)
ask_naked_reg = 1;
ask_naked_reg = -1;
else
as_bad (_("bad argument to syntax directive."));
- *input_line_pointer = e;
+ (void) restore_line_pointer (e);
}
demand_empty_rest_of_line ();
if (!is_end_of_line[(unsigned char) *input_line_pointer])
{
- char *string = input_line_pointer;
- int e = get_symbol_end ();
+ char *string;
+ int e = get_symbol_name (&string);
if (strcmp (string, "none") == 0)
*kind = check_none;
*kind = check_error;
else
as_bad (_("bad argument to %s_check directive."), str);
- *input_line_pointer = e;
+ (void) restore_line_pointer (e);
}
else
as_bad (_("missing argument for %s_check directive"), str);
if (!is_end_of_line[(unsigned char) *input_line_pointer])
{
- char *string = input_line_pointer;
- int e = get_symbol_end ();
+ char *string;
+ int e = get_symbol_name (&string);
unsigned int j;
i386_cpu_flags flags;
cpu_arch_flags = flags;
cpu_arch_isa_flags = flags;
}
- *input_line_pointer = e;
+ (void) restore_line_pointer (e);
demand_empty_rest_of_line ();
return;
}
if (*input_line_pointer == ','
&& !is_end_of_line[(unsigned char) input_line_pointer[1]])
{
- char *string = ++input_line_pointer;
- int e = get_symbol_end ();
+ char *string;
+ char e;
+
+ ++input_line_pointer;
+ e = get_symbol_name (&string);
if (strcmp (string, "nojumps") == 0)
no_cond_jump_promotion = 1;
else
as_bad (_("no such architecture modifier: `%s'"), string);
- *input_line_pointer = e;
+ (void) restore_line_pointer (e);
}
demand_empty_rest_of_line ();
/* Skip optional white space before operand. */
if (is_space_char (*l))
++l;
- if (!is_operand_char (*l) && *l != END_OF_INSN)
+ if (!is_operand_char (*l) && *l != END_OF_INSN && *l != '"')
{
as_bad (_("invalid character %s before operand %d"),
output_invalid (*l),
i.operands + 1);
return NULL;
}
- token_start = l; /* after white space */
+ token_start = l; /* After white space. */
paren_not_balanced = 0;
while (paren_not_balanced || *l != ',')
{
else
break; /* we are done */
}
- else if (!is_operand_char (*l) && !is_space_char (*l))
+ else if (!is_operand_char (*l) && !is_space_char (*l) && *l != '"')
{
as_bad (_("invalid character %s in operand %d"),
output_invalid (*l),
}
else if (is_digit_char (*op_string)
|| is_identifier_char (*op_string)
+ || *op_string == '"'
|| *op_string == '(')
{
/* This is a memory reference of some sort. */
symbolS *symbolP;
input_line_pointer = reg_string;
- c = get_symbol_end ();
+ c = get_symbol_name (®_string);
symbolP = symbol_find (reg_string);
if (symbolP && S_GET_SEGMENT (symbolP) == reg_section)
{
char *name;
char c;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
if (strcasecmp (name, "little") == 0)
;
else if (strcasecmp (name, "big") == 0)
else
as_warn (_("ignoring unrecognized .endian type `%s'"), name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
return;
}
- sym_name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&sym_name);
if (input_line_pointer == sym_name)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
as_bad (_("expected symbol name"));
ignore_rest_of_line ();
return;
}
symbolP = symbol_find_or_make (sym_name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if ((S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
&& !S_IS_COMMON (symbolP))
if (is_it_end_of_statement ())
return;
- radix = input_line_pointer;
- ch = get_symbol_end ();
+ ch = get_symbol_name (&radix);
ia64_canonicalize_symbol_name (radix);
if (strcasecmp (radix, "C"))
as_bad (_("Radix `%s' unsupported or invalid"), radix);
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
demand_empty_rest_of_line ();
}
if (sep == ',')
{
+ char *name;
/* Parse a tag permitted for the current directive. */
int ch;
SKIP_WHITESPACE ();
- ch = get_symbol_end ();
+ ch = get_symbol_name (&name);
/* FIXME: For now, just issue a warning that this isn't implemented. */
{
static int warned;
as_warn (_("Tags on unwind pseudo-ops aren't supported, yet"));
}
}
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
}
if (sep != NOT_A_CHAR)
demand_empty_rest_of_line ();
dot_personality (int dummy ATTRIBUTE_UNUSED)
{
char *name, *p, c;
+
if (!in_procedure ("personality"))
return;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
unwind.personality_routine = symbol_find_or_make (name);
unwind.force_unwind_entry = 1;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
demand_empty_rest_of_line ();
}
while (1)
{
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
if (!*name)
as_bad (_("Empty argument of .proc"));
symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
}
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
break;
++input_line_pointer;
char *name, *p, c;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
if (!*name)
(md.unwind_check == unwind_check_warning
as_warn (_("`%s' was not specified with previous .proc"), name);
}
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
break;
++input_line_pointer;
drpp = &md.dynreg[type];
while (1)
{
- start = input_line_pointer;
- ch = get_symbol_end ();
+ ch = get_symbol_name (&start);
len = strlen (ia64_canonicalize_symbol_name (start));
*input_line_pointer = ch;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != '[')
{
as_bad (_("Expected '['"));
while (1)
{
- option = input_line_pointer;
- ch = get_symbol_end ();
+ ch = get_symbol_name (&option);
if (strcmp (option, "lsb") == 0)
md.flags &= ~EF_IA_64_BE;
else if (strcmp (option, "msb") == 0)
as_bad (_("Unknown psr option `%s'"), option);
*input_line_pointer = ch;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
break;
char *start, *end;
int saved_auto_align;
unsigned int section_count;
+ char *name;
+ char c;
SKIP_WHITESPACE ();
start = input_line_pointer;
- if (*start == '"')
- {
- int len;
- char *name;
-
- name = demand_copy_C_string (&len);
- obstack_free(¬es, name);
- if (!name)
- {
- ignore_rest_of_line ();
- return;
- }
- }
- else
+ c = get_symbol_name (&name);
+ if (input_line_pointer == start)
{
- char c = get_symbol_end ();
-
- if (input_line_pointer == start)
- {
- as_bad (_("Missing section name"));
- ignore_rest_of_line ();
- return;
- }
- *input_line_pointer = c;
+ as_bad (_("Missing section name"));
+ ignore_rest_of_line ();
+ return;
}
+ * input_line_pointer = c;
+ SKIP_WHITESPACE_AFTER_NAME ();
end = input_line_pointer;
- SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
as_bad (_("Comma expected after section name"));
}
else if (*input_line_pointer == '@')
{
- char *form = ++input_line_pointer;
- char c = get_symbol_end();
+ char *form;
+ char c;
+
+ ++input_line_pointer;
+ c = get_symbol_name (&form);
if (strcmp (form, "mutex") == 0)
type = 'm';
type = 'c';
else if (strcmp (form, "imply") == 0)
type = 'i';
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else
{
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
err = hash_insert (md.entry_hash, S_GET_NAME (symbolP), (void *) symbolP);
name, err);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
c = *input_line_pointer;
if (c == ',')
{
recognize labels. */
if (is_name_beginner (*input_line_pointer))
{
- s = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&s);
}
else if (LOCAL_LABELS_FB
&& ISDIGIT (*input_line_pointer))
/* extract the opcode (mnemonic): */
- mnemonic = input_line_pointer;
- ch = get_symbol_end ();
+ ch = get_symbol_name (&mnemonic);
pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic);
if (pdesc)
{
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
(*pdesc->handler) (pdesc->arg);
goto done;
}
/* Find the instruction descriptor matching the arguments. */
idesc = ia64_find_opcode (mnemonic);
- *input_line_pointer = ch;
+ (void) restore_line_pointer (ch);
if (!idesc)
{
as_bad (_("Unknown opcode `%s'"), mnemonic);
struct hash_control *ahash, *nhash;
const char *kind;
- name = input_line_pointer;
- delim = get_symbol_end ();
+ delim = get_symbol_name (&name);
end_name = input_line_pointer;
*end_name = delim;
return;
}
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
char *name;
symbolS *p;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = (symbolS *) symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
return p;
}
{
char *name;
char delim;
- char *end_name;
symbolS *symbolP;
sym_linkS *lnk;
- name = input_line_pointer;
- delim = get_symbol_end ();
- end_name = input_line_pointer;
+ delim = get_symbol_name (&name);
if ((symbolP = symbol_find (name)) == NULL
&& (symbolP = md_undefined_symbol (name)) == NULL)
symbol_get_obj (symbolP)->local = 1;
}
- *end_name = delim;
+ (void) restore_line_pointer (delim);
demand_empty_rest_of_line ();
}
offsetT align;
int align2;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
as_bad (_("Expected comma after symbol-name: rest of line ignored."));
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
int i;
s = input_line_pointer;
- /* We can't use get_symbol_end since the processor names are not proper
+ /* We can't use get_symbol_name since the processor names are not proper
symbols. */
while (is_part_of_name (c = *input_line_pointer++))
;
{
++input_line_pointer;
s = input_line_pointer;
- /* We can't use get_symbol_end since the processor names are not
+ /* We can't use get_symbol_name since the processor names are not
proper symbols. */
while (is_part_of_name (c = *input_line_pointer++))
;
t = 0;
}
- s = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&s);
for (i = 0, o = opt_table; i < OPTCOUNT; i++, o++)
{
{
/* Restore input_line_pointer now in case the option
takes arguments. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
(*o->pfn) (o->arg, t);
}
else if (o->pvar != NULL)
{
if (! t && o->arg == o->notarg)
as_bad (_("option `%s' may not be negated"), s);
- *input_line_pointer = c;
+ restore_line_pointer (c);
*o->pvar = t ? o->arg : o->notarg;
}
else
if (i >= OPTCOUNT)
{
as_bad (_("option `%s' not recognized"), s);
- *input_line_pointer = c;
+ restore_line_pointer (c);
}
}
while (*input_line_pointer++ == ',');
segT current_seg = now_seg;
subsegT current_subseg = now_subseg;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
static void
microblaze_s_func (int end_p ATTRIBUTE_UNUSED)
{
- *input_line_pointer = get_symbol_end ();
+ char *name;
+ restore_line_pointer (get_symbol_name (&name));
s_func (1);
}
symbolS *symbolP;
expressionS exp;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
S_SET_WEAK (symbolP);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
char *name;
symbolS *p;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = (symbolS *) symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
return p;
}
void
s_change_section (int ignore ATTRIBUTE_UNUSED)
{
+ char *saved_ilp;
char *section_name;
- char c;
+ char c, endc;
char next_c = 0;
int section_type;
int section_flag;
int section_entry_size;
int section_alignment;
- section_name = input_line_pointer;
- c = get_symbol_end ();
+ saved_ilp = input_line_pointer;
+ endc = get_symbol_name (§ion_name);
+ c = (endc == '"' ? input_line_pointer[1] : endc);
if (c)
- next_c = *(input_line_pointer + 1);
+ next_c = input_line_pointer [(endc == '"' ? 2 : 1)];
/* Do we have .section Name<,"flags">? */
if (c != ',' || (c == ',' && next_c == '"'))
{
- /* just after name is now '\0'. */
- *input_line_pointer = c;
- input_line_pointer = section_name;
+ /* Just after name is now '\0'. */
+ (void) restore_line_pointer (endc);
+ input_line_pointer = saved_ilp;
obj_elf_section (ignore);
return;
}
+
+ section_name = xstrdup (section_name);
+ c = restore_line_pointer (endc);
+
input_line_pointer++;
/* Do we have .section Name<,type><,flag><,entry_size><,alignment> */
section_type = get_absolute_expression ();
else
section_type = 0;
+
if (*input_line_pointer++ == ',')
section_flag = get_absolute_expression ();
else
section_flag = 0;
+
if (*input_line_pointer++ == ',')
section_entry_size = get_absolute_expression ();
else
section_entry_size = 0;
+
if (*input_line_pointer++ == ',')
section_alignment = get_absolute_expression ();
else
section_alignment = 0;
+
/* FIXME: really ignore? */
(void) section_alignment;
- section_name = xstrdup (section_name);
-
/* When using the generic form of .section (as implemented by obj-elf.c),
there's no way to set the section type to SHT_MIPS_DWARF. Users have
traditionally had to fall back on the more common @progbits instead.
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
S_SET_EXTERNAL (symbolP);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
/* On Irix 5, every global symbol that is not explicitly labelled as
being a function is apparently labelled as being an object. */
char *secname;
asection *sec;
- secname = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&secname);
sec = bfd_get_section_by_name (stdoutput, secname);
if (sec == NULL)
as_bad (_("%s: no such section"), secname);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (sec != NULL && (sec->flags & SEC_CODE) != 0)
flag = BSF_FUNCTION;
char *opt;
char c;
- opt = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&opt);
if (*opt == 'O')
{
else
as_warn (_("unrecognized option \"%s\""), opt);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
symbolS *symbolP;
expressionS exp;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
S_SET_WEAK (symbolP);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (! is_end_of_line[(unsigned char) *input_line_pointer])
{
p++;
sregp = p;
input_line_pointer = sregp;
- c = get_symbol_end ();
+ c = get_symbol_name (&sregp);
sregend = input_line_pointer;
+ if (c == '"')
+ ++ input_line_pointer;
}
}
else
expp_sreg = &exp[0];
expp_reg = &exp[1];
- sregp = p;
- c = get_symbol_end ();
- sregend = p = input_line_pointer;
- *p = c;
+ c = get_symbol_name (&sregp);
+ sregend = input_line_pointer;
+ restore_line_pointer (c);
+ p = input_line_pointer;
/* Skip whitespace */
while (*p == ' ' || *p == '\t')
SKIP_WHITESPACE ();
- p = input_line_pointer;
-
- c = get_symbol_end ();
-
+ c = get_symbol_name (&p);
+
/* Reseting prefix? */
if (*p == ':' && p[1] == 0)
mmix_current_prefix = NULL;
mmix_current_prefix = p;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
mmix_handle_rest_of_empty_line ();
}
{
char *p;
char c;
- p = input_line_pointer;
/* This will skip over what can be a symbol and zero out the next
character, which we assume is a ',' or other meaningful delimiter.
What comes after that is the initializer expression for the
register. */
- c = get_symbol_end ();
+ c = get_symbol_name (&p);
+
+ if (c == '"')
+ c = * ++ input_line_pointer;
if (! is_end_of_line[(unsigned char) c])
input_line_pointer++;
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (data_registers, DATA_REG_NAME_CNT, name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number >= 0)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (address_registers, ADDRESS_REG_NAME_CNT, name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number >= 0)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (other_registers, OTHER_REG_NAME_CNT, name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number >= 0)
}
else if (operand->flags & MN10200_OPERAND_PSW)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcmp (start, "psw") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10200_OPERAND_MDR)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
+ (void) restore_line_pointer (c);
if (strcmp (start, "mdr") != 0)
{
- *input_line_pointer = c;
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
goto keep_going;
}
else if (data_register_name (&ex))
}
}
}
-
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
+ start = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
reg_number = reg_name_search (table, table_length, name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number >= 0)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
+ start = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
reg_number = reg_name_search (other_registers, ARRAY_SIZE (other_registers), name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number == 0
}
else if (operand->flags & MN10300_OPERAND_SP)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "sp") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_RREG)
}
else if (operand->flags & MN10300_OPERAND_FPCR)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "fpcr") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_USP)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "usp") != 0)
{
+ (void) restore_line_pointer (c);
*input_line_pointer = c;
input_line_pointer = hold;
str = hold;
goto error;
}
+ (void) restore_line_pointer (c);
*input_line_pointer = c;
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_SSP)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "ssp") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_MSP)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "msp") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_PC)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "pc") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_EPSW)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "epsw") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_PLUS)
}
else if (operand->flags & MN10300_OPERAND_PSW)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "psw") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_MDR)
{
- char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *start;
+ char c = get_symbol_name (&start);
if (strcasecmp (start, "mdr") != 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = hold;
str = hold;
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
goto keep_going;
}
else if (operand->flags & MN10300_OPERAND_REG_LIST)
if (*input_line_pointer == ',')
input_line_pointer++;
- start = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&start);
if (strcasecmp (start, "d2") == 0)
{
value |= 0x80;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (strcasecmp (start, "d3") == 0)
{
value |= 0x40;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (strcasecmp (start, "a2") == 0)
{
value |= 0x20;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (strcasecmp (start, "a3") == 0)
{
value |= 0x10;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (strcasecmp (start, "other") == 0)
{
value |= 0x08;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (HAVE_AM33
&& strcasecmp (start, "exreg0") == 0)
{
value |= 0x04;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (HAVE_AM33
&& strcasecmp (start, "exreg1") == 0)
{
value |= 0x02;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (HAVE_AM33
&& strcasecmp (start, "exother") == 0)
{
value |= 0x01;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else if (HAVE_AM33
&& strcasecmp (start, "all") == 0)
{
value |= 0xff;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else
{
static void
s_nios2_set (int equiv)
{
- char *directive = input_line_pointer;
- char delim = get_symbol_end ();
+ char *directive;
+ char delim = get_symbol_name (&directive);
char *endline = input_line_pointer;
- *endline = delim;
+
+ (void) restore_line_pointer (delim);
/* We only want to handle ".set XXX" if the
user has tried ".set XXX, YYY" they are not
else if (!reg_names_p || !ISALPHA (name[0]))
return FALSE;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name);
/* Put back the delimiting char. */
char *pfrag;
int align2;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
- /* just after name is now '\0'. */
+ /* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
as_bad (_("expected comma after symbol-name: rest of line ignored."));
static void
ppc_elf_localentry (int ignore ATTRIBUTE_UNUSED)
{
- char *name = input_line_pointer;
- char c = get_symbol_end ();
+ char *name;
+ char c = get_symbol_name (&name);
char *p;
expressionS exp;
symbolS *sym;
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
*p = 0;
SKIP_WHITESPACE ();
/* Find the spelling of the operand. */
- toc_spec = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&toc_spec);
if (strcmp (toc_spec, "toc") == 0)
{
/* Now find the ']'. */
*input_line_pointer = c;
- SKIP_WHITESPACE (); /* leading whitespace could be there. */
+ SKIP_WHITESPACE_AFTER_NAME (); /* leading whitespace could be there. */
c = *input_line_pointer++; /* input_line_pointer->past char in c. */
if (c != ']')
symbolS *sym;
char *pfrag;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
end_name = input_line_pointer;
- *end_name = endc;
+ (void) restore_line_pointer (endc);
if (*input_line_pointer != ',')
{
}
++input_line_pointer;
- lcomm_name = input_line_pointer;
- lcomm_endc = get_symbol_end ();
+ lcomm_endc = get_symbol_name (&lcomm_name);
lcomm_sym = symbol_find_or_make (lcomm_name);
- *input_line_pointer = lcomm_endc;
+ (void) restore_line_pointer (lcomm_endc);
/* The fourth argument to .lcomm is the alignment. */
if (*input_line_pointer != ',')
symbolS *sym;
offsetT align;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
if (S_GET_NAME (sym)[0] == '\0')
{
/* Parse opt-label. */
if (*input_line_pointer == ',')
{
- const char *label;
+ char *label;
char c;
++input_line_pointer;
- label = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&label);
opt_label = symbol_find_or_make (label);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
else
opt_label = NULL;
char c;
symbolS *sym;
- user_name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&user_name);
if (strcmp (user_name, ".text") == 0)
real_name = ".text[PR]";
else
{
as_bad (_("the XCOFF file format does not support arbitrary sections"));
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
ignore_rest_of_line ();
return;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
sym = symbol_find_or_make (real_name);
char *name;
char endc;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
(void) symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
demand_empty_rest_of_line ();
}
char endc;
symbolS *sym;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
symbol_get_tc (sym)->output = 1;
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
fix_at_start (symbol_get_frag (ppc_current_csect), 0,
symbol_find_or_make (name), 0, FALSE, BFD_RELOC_NONE);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
c = *input_line_pointer;
if (c == ',')
{
symbolS *sym;
int len;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
if (*input_line_pointer != ',')
{
symbolS *ext_sym;
symbolS *lab_sym;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
/* Ignore any [PR] suffix. */
name = ppc_canonicalize_symbol_name (name);
ext_sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
if (*input_line_pointer != ',')
{
}
++input_line_pointer;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
lab_sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
if (ext_sym != lab_sym)
{
if (ppc_current_block != NULL)
as_bad (_("nested .bs blocks"));
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
csect = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
sym = symbol_make (".bs");
S_SET_SEGMENT (sym, now_seg);
return;
}
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
if (S_IS_DEFINED (sym))
{
static void
ppc_machine (int ignore ATTRIBUTE_UNUSED)
{
+ char c;
char *cpu_string;
#define MAX_HISTORY 100
static ppc_cpu_t *cpu_history;
SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
- {
- int len;
- cpu_string = demand_copy_C_string (&len);
- }
- else
- {
- char c;
- cpu_string = input_line_pointer;
- c = get_symbol_end ();
- cpu_string = xstrdup (cpu_string);
- *input_line_pointer = c;
- }
+ c = get_symbol_name (&cpu_string);
+ cpu_string = xstrdup (cpu_string);
+ (void) restore_line_pointer (c);
if (cpu_string != NULL)
{
char *name;
/* Strip out the symbol name. */
- symbol_name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&symbol_name);
name = xmalloc (input_line_pointer - symbol_name + 1);
strcpy (name, symbol_name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
/* Look up the opcode in the hash table. */
opcode = (const struct powerpc_opcode *) hash_find (ppc_hash, "nop");
symbolS *symbolP;
offsetT align;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
as_bad (_("expected comma after symbol-name: rest of line ignored."));
segT sec;
int align;
- section_name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (§ion_name);
name = xmalloc (input_line_pointer - section_name + 1);
strcpy (name, section_name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
exp = 0;
flags = SEC_NO_FLAGS;
char endc;
symbolS *ext_sym;
- name = input_line_pointer;
- endc = get_symbol_end ();
+ endc = get_symbol_name (&name);
ext_sym = symbol_find_or_make (name);
- *input_line_pointer = endc;
+ (void) restore_line_pointer (endc);
S_SET_DATA_TYPE (ext_sym, DT_FCN << N_BTSHFT);
SF_SET_FUNCTION (ext_sym);
else
return FALSE;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
reg_number = reg_name_search (name);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
/* Look to see if it's in the register table. */
if (reg_number >= 0)
else
{
char c;
- cpu_string = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&cpu_string);
cpu_string = xstrdup (cpu_string);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
if (cpu_string != NULL)
SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
- {
- int len;
- mode_string = demand_copy_C_string (&len);
- }
- else
- {
- char c;
- mode_string = input_line_pointer;
- c = get_symbol_end ();
- mode_string = xstrdup (mode_string);
- *input_line_pointer = c;
- }
+ {
+ char c;
+
+ c = get_symbol_name (&mode_string);
+ mode_string = xstrdup (mode_string);
+ (void) restore_line_pointer (c);
+ }
if (mode_string != NULL)
{
char *name;
symbolS *p;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = (symbolS *) symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
return p;
}
segT bss_seg = bss_section;
int needs_align = 0;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
if (name == p)
{
char *name;
symbolS *p;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = (symbolS *) symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
return p;
}
segT bss_seg = bss_section;
int needs_align = 0;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
*p = c;
return;
}
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
/* Accept an optional comma after the name. The comma used to be
required, but Irix 5 cc does not generate it. */
int temp;
symbolS *symbolP;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
offsetT temp, size;
symbolS *symbolP;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
as_bad (_("Expected comma after symbol-name"));
char c;
int reg;
int flags;
- const char *regname;
+ char *regname;
if (input_line_pointer[0] != '%'
|| input_line_pointer[1] != 'g'
if (*input_line_pointer == '#')
{
++input_line_pointer;
- regname = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (®name);
if (strcmp (regname, "scratch") && strcmp (regname, "ignore"))
as_bad (_("register syntax is .register %%g[2367],{#scratch|symbolname|#ignore}"));
if (regname[0] == 'i')
}
else
{
- regname = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (®name);
}
+
if (sparc_arch_size == 64)
{
if (globals[reg])
}
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
return;
}
*input_line_pointer++ = '\0';
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
tmp = xmalloc (strlen (str) + 1);
strcpy (tmp, str);
str = tmp;
hash_replace (tic4x_asg_hash, name, (void *) str);
else
hash_insert (tic4x_asg_hash, name, (void *) str);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
current_subseg = now_subseg; /* Save current subseg. */
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
if (c != ',')
{
as_bad (_(".bss size argument missing\n"));
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
S_SET_STORAGE_CLASS (symbolP, C_EXT);
S_SET_EXTERNAL (symbolP);
if (c == ',')
as_bad (_("Symbol missing\n"));
return;
}
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
tic4x_insert_sym (name, value);
- *input_line_pointer++ = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
SKIP_WHITESPACE ();
if (*input_line_pointer == '"')
input_line_pointer++;
- section_name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (§ion_name); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
input_line_pointer++; /* Skip null symbol terminator. */
name = xmalloc (input_line_pointer - section_name + 1);
strcpy (name, section_name);
Volker Kuhlmann <v.kuhlmann@elec.canterbury.ac.nz>. */
if (c == ':')
{
- c = get_symbol_end (); /* Get terminator. */
+ char *subname;
+ c = get_symbol_name (&subname); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
input_line_pointer++; /* Skip null symbol terminator. */
as_warn (_(".sect: subsection name ignored"));
}
/* We might still have a '"' to discard, but the character after a
- symbol name will be overwritten with a \0 by get_symbol_end()
+ symbol name will be overwritten with a \0 by get_symbol_name()
[VK]. */
if (c == ',')
bfd_errmsg (bfd_get_error ()));
}
- /* If the last character overwritten by get_symbol_end() was an
+ /* If the last character overwritten by get_symbol_name() was an
end-of-line, we must restore it or the end of the line will not be
recognised and scanning extends into the next line, stopping with
an error (blame Volker Kuhlmann <v.kuhlmann@elec.canterbury.ac.nz>
char c;
char *name;
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
if (c != ',')
{
as_bad (_(".set syntax invalid\n"));
SKIP_WHITESPACE ();
if (*input_line_pointer == '"')
input_line_pointer++;
- section_name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (§ion_name); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
input_line_pointer++; /* Skip null symbol terminator. */
name = xmalloc (input_line_pointer - section_name + 1);
strcpy (name, section_name);
input_line_pointer = s;
SKIP_WHITESPACE ();
- str = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&str); /* Get terminator. */
new_pointer = input_line_pointer;
if (strlen (str) && (entry = hash_find (tic4x_asg_hash, str)) != NULL)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = (char *) entry;
}
else
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = str;
}
return;
}
- name = ++input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ ++input_line_pointer;
+ c = get_symbol_name (&name); /* Get terminator. */
if (!ISALPHA (*name))
{
as_bad (_("symbols assigned with .asg must begin with a letter"));
strcpy (tmp, name);
name = tmp;
subsym_create_or_replace (name, str);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
ignore_rest_of_line ();
return;
}
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
tmp = xmalloc (strlen (name) + 1);
name = strcpy (tmp, name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (!ISALPHA (*name))
{
current_seg = now_seg; /* Save current seg. */
current_subseg = now_subseg; /* Save current subseg. */
- name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
+ c = get_symbol_name (&name); /* Get terminator. */
+ if (c == '"')
+ c = * ++ input_line_pointer;
if (c != ',')
{
as_bad (_(".bss size argument missing\n"));
static void
tic54x_tag (int ignore ATTRIBUTE_UNUSED)
{
- char *name = input_line_pointer;
- int c = get_symbol_end ();
+ char *name;
+ int c = get_symbol_name (&name);
struct stag *stag = (struct stag *) hash_find (stag_hash, name);
if (!stag)
if (current_stag != NULL && !current_stag->is_union)
abs_section_offset += stag->size;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
line_label = NULL;
}
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
+ c = restore_line_pointer (c);
- *input_line_pointer = c;
S_SET_STORAGE_CLASS (symbolP, C_EXT);
if (c == ',')
{
else
{
int c;
- name = input_line_pointer;
- c = get_symbol_end ();
+
+ c = get_symbol_name (&name);
len = strlen(name);
name = strcpy (xmalloc (len + 10), name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
+
/* Make sure all named initialized sections flagged properly. If we
encounter instructions, we'll flag it with SEC_CODE as well. */
strcat (name, ",\"w\"\n");
current_seg = now_seg; /* Save current seg. */
current_subseg = now_subseg; /* Save current subseg. */
- if (*input_line_pointer == '"')
- input_line_pointer++;
- section_name = input_line_pointer;
- c = get_symbol_end (); /* Get terminator. */
- input_line_pointer++; /* Skip null symbol terminator. */
+ c = get_symbol_name (§ion_name); /* Get terminator. */
name = xmalloc (input_line_pointer - section_name + 1);
strcpy (name, section_name);
-
- if (*input_line_pointer == ',')
+ c = restore_line_pointer (c);
+
+ if (c == ',')
++input_line_pointer;
- else if (c != ',')
+ else
{
as_bad (_("Missing size argument"));
ignore_rest_of_line ();
static void
tic54x_label (int ignored ATTRIBUTE_UNUSED)
{
- char *name = input_line_pointer;
+ char *name;
symbolS *symbolP;
int c;
ILLEGAL_WITHIN_STRUCT ();
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = colon (name);
S_SET_STORAGE_CLASS (symbolP, C_STATLAB);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
}
else
{
- char *section_name = input_line_pointer;
+ char *section_name;
- c = get_symbol_end ();
+ c = get_symbol_name (§ion_name);
name = xmalloc (strlen (section_name) + 1);
strcpy (name, section_name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
seg = bfd_get_section_by_name (stdoutput, name);
ignore_rest_of_line ();
return;
}
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* .var symbols start out with a null string. */
name = strcpy (xmalloc (strlen (name) + 1), name);
hash_insert (subsym_hash[macro_level], name, empty);
- *input_line_pointer = c;
+ c = restore_line_pointer (c);
if (c == ',')
{
++input_line_pointer;
if (forced)
++ptr;
- name = input_line_pointer = ptr;
- c = get_symbol_end ();
+ input_line_pointer = ptr;
+ c = get_symbol_name (&name);
/* '?' is not normally part of a symbol, but it IS part of a local
label. */
if (c == '?')
int c;
input_line_pointer = line;
- c = get_symbol_end ();
+ c = get_symbol_name (&line);
if (cpu == VNONE)
cpu = V542;
static void
s_tic6x_personality (int ignored ATTRIBUTE_UNUSED)
{
- char *name, *p, c;
+ char *name, c;
tic6x_unwind_info *unwind = tic6x_get_unwind ();
if (unwind->personality_routine || unwind->personality_index != -1)
as_bad (_("duplicate .personality directive"));
- name = input_line_pointer;
- c = get_symbol_end ();
- p = input_line_pointer;
+ c = get_symbol_name (&name);
unwind->personality_routine = symbol_find_or_make (name);
- *p = c;
+ (void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
offsetT align;
int align2;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
- *p = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
static void
parse_reg_expression (expressionS* expression)
{
+ char *regname;
+ char terminating_char;
+ void *pval;
+ int regno_and_flags;
+ int regno;
+
/* Zero everything to make sure we don't miss any flags. */
memset (expression, 0, sizeof *expression);
- char* regname = input_line_pointer;
- char terminating_char = get_symbol_end ();
-
- void* pval = hash_find (main_reg_hash, regname);
+ terminating_char = get_symbol_name (®name);
+ pval = hash_find (main_reg_hash, regname);
if (pval == NULL)
- {
- as_bad (_("Expected register, got '%s'."), regname);
- }
+ as_bad (_("Expected register, got '%s'."), regname);
- int regno_and_flags = (int)(size_t)pval;
- int regno = EXTRACT_REGNO(regno_and_flags);
+ regno_and_flags = (int)(size_t)pval;
+ regno = EXTRACT_REGNO(regno_and_flags);
if ((regno_and_flags & NONCANONICAL_REG_NAME_FLAG)
&& require_canonical_reg_names)
- {
- as_warn (_("Found use of non-canonical register name %s; "
- "use %s instead."),
- regname,
- tilegx_register_names[regno]);
- }
+ as_warn (_("Found use of non-canonical register name %s; "
+ "use %s instead."),
+ regname, tilegx_register_names[regno]);
/* Restore the old character following the register name. */
- *input_line_pointer = terminating_char;
+ (void) restore_line_pointer (terminating_char);
/* Fill in the expression fields to indicate it's a register. */
expression->X_op = O_register;
/* Zero everything to make sure we don't miss any flags. */
memset (expression, 0, sizeof *expression);
- char* regname = input_line_pointer;
- char terminating_char = get_symbol_end ();
+ char terminating_char = get_symbol_name (®name);
void* pval = hash_find (main_reg_hash, regname);
regname, tilepro_register_names[regno]);
/* Restore the old character following the register name. */
- *input_line_pointer = terminating_char;
+ (void) restore_line_pointer (terminating_char);
/* Fill in the expression fields to indicate it's a register. */
expression->X_op = O_register;
symbolS *symbolP;
int have_align;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
/* Just after name is now '\0'. */
p = input_line_pointer;
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT,
name, FALSE);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
expressionP->X_add_symbol = NULL;
expressionP->X_op_symbol = NULL;
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (system_registers, SYSREG_NAME_CNT, name,
accept_numbers);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (reg_number < 0
&& accept_numbers)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (cc_names, CC_NAME_CNT, name, accept_numbers);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (reg_number < 0
&& accept_numbers)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (float_cc_names, FLOAT_CC_NAME_CNT, name, accept_numbers);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (reg_number < 0
&& accept_numbers)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (cacheop_names, CACHEOP_NAME_CNT, name, accept_numbers);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (reg_number < 0
&& accept_numbers)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (prefop_names, PREFOP_NAME_CNT, name, accept_numbers);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
if (reg_number < 0
&& accept_numbers)
char c;
/* Find the spelling of the operand. */
- start = name = input_line_pointer;
-
- c = get_symbol_end ();
+ start = input_line_pointer;
+ c = get_symbol_name (&name);
reg_number = reg_name_search (vector_registers, VREG_NAME_CNT,
name, FALSE);
/* Put back the delimiting char. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
expressionP->X_add_symbol = NULL;
expressionP->X_op_symbol = NULL;
else if ((operand->flags & V850_OPERAND_EP) != 0)
{
char *start = input_line_pointer;
- char c = get_symbol_end ();
+ char *name;
+ char c = get_symbol_name (&name);
- if (strcmp (start, "ep") != 0 && strcmp (start, "r30") != 0)
+ if (strcmp (name, "ep") != 0 && strcmp (name, "r30") != 0)
{
/* Put things back the way we found them. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = start;
errmsg = _("expected EP register");
goto error;
}
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
str = input_line_pointer;
input_line_pointer = hold;
else if ((register_name (&ex)
&& (operand->flags & V850_OPERAND_REG) == 0))
{
+ char *name;
char c;
int exists = 0;
input_line_pointer = str;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
- if (symbol_find (str) != NULL)
+ if (symbol_find (name) != NULL)
exists = 1;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = str;
expression (&ex);
frag_align (2, 0, 0);
record_alignment (now_seg, 2);
- c = get_symbol_end ();
+ c = get_symbol_name (&base_name);
/* Just after name is now '\0'. */
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',' && *input_line_pointer != ':')
{
xtensa_restore_emit_state (&state);
return;
}
- *p = 0;
+ *p = 0;
colon (base_name);
-
*p = c;
+
input_line_pointer++; /* skip ',' or ':' */
xtensa_elf_cons (4);
/* Check for <label>[:] [.](EQU|DEFL) <value>. */
if (is_name_beginner (*input_line_pointer))
{
+ char *name;
char c, *rest, *line_start;
int len;
if (ignore_input ())
return 0;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
rest = input_line_pointer + 1;
if (*rest == ':')
}
input_line_pointer = rest + len - 1;
/* Allow redefining with "DEFL" (len == 4), but not with "EQU". */
- equals (line_start, len == 4);
+ equals (name, len == 4);
return 1;
}
else
{
/* Restore line and pointer. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = line_start;
}
}
are noted in @ref{Machine Dependencies}.
@end ifset
No symbol may begin with a digit. Case is significant.
-There is no length limit: all characters are significant. Multibyte characters
+There is no length limit; all characters are significant. Multibyte characters
are supported. Symbols are delimited by characters not in that set, or by the
beginning of a file (since the source program must end with a newline, the end
of a file is not a possible symbol delimiter). @xref{Symbols}.
+
+Symbol names may also be enclosed in double quote @code{"} characters. In such
+cases any characters are allowed, except for the NUL character. If a double
+quote character is to be included in the symbol name it must be preceeded by a
+backslash @code{\} character.
@cindex length of symbols
@node Statements
{
char *name, c;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
exp->X_op = O_constant;
exp->X_add_number = tc_regname_to_dw2regnum (name);
- *input_line_pointer = c;
+ restore_line_pointer (c);
}
else
# endif
int sections = 0;
SKIP_WHITESPACE ();
- if (is_name_beginner (*input_line_pointer))
+ if (is_name_beginner (*input_line_pointer) || *input_line_pointer == '"')
while (1)
{
+ char * saved_ilp;
char *name, c;
- name = input_line_pointer;
- c = get_symbol_end ();
+ saved_ilp = input_line_pointer;
+ c = get_symbol_name (& name);
if (strncmp (name, ".eh_frame", sizeof ".eh_frame") == 0
&& name[9] != '_')
else
{
*input_line_pointer = c;
- input_line_pointer = name;
+ input_line_pointer = saved_ilp;
break;
}
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer == ',')
{
name = input_line_pointer++;
SKIP_WHITESPACE ();
- if (!is_name_beginner (*input_line_pointer))
+ if (!is_name_beginner (*input_line_pointer) && *input_line_pointer != '"')
{
input_line_pointer = name;
break;
}
}
- else if (is_name_beginner (*input_line_pointer))
+ else if (is_name_beginner (*input_line_pointer) || *input_line_pointer == '"')
break;
}
cfi_new_fde (symbol_temp_new_now ());
SKIP_WHITESPACE ();
- if (is_name_beginner (*input_line_pointer))
+ if (is_name_beginner (*input_line_pointer) || *input_line_pointer == '"')
{
+ char * saved_ilp = input_line_pointer;
char *name, c;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
if (strcmp (name, "simple") == 0)
{
simple = 1;
- *input_line_pointer = c;
+ restore_line_pointer (c);
}
else
- input_line_pointer = name;
+ input_line_pointer = saved_ilp;
}
demand_empty_rest_of_line ();
char *p, c;
offsetT value;
- p = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& p);
if (strcmp (p, "basic_block") == 0)
{
}
else if (strcmp (p, "is_stmt") == 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
value = get_absolute_expression ();
if (value == 0)
current.flags &= ~DWARF2_FLAG_IS_STMT;
}
else if (strcmp (p, "isa") == 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
value = get_absolute_expression ();
if (value >= 0)
current.isa = value;
}
else if (strcmp (p, "discriminator") == 0)
{
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
value = get_absolute_expression ();
if (value >= 0)
current.discriminator = value;
else
{
as_bad (_("unknown .loc sub-directive `%s'"), p);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
return;
}
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
}
demand_empty_rest_of_line ();
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
(void) add_ecoff_symbol ((const char *) NULL, st_Block, sc_Text,
symbol_find_or_make (name),
(bfd_vma) 0, (symint_t) 0, (symint_t) 0);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
/* The line number follows, but we don't use it. */
(void) get_absolute_expression ();
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
/* The value is the distance between the .bend directive and the
corresponding symbol. We fill in the offset when we write out
(void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text, endsym,
(bfd_vma) 0, (symint_t) 0, (symint_t) 0);
- *input_line_pointer = name_end;
+ restore_line_pointer (name_end);
/* The line number follows, but we don't use it. */
(void) get_absolute_expression ();
SKIP_WHITESPACE ();
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
if (coff_sym_name != (char *) NULL)
as_warn (_(".def pseudo-op used inside of .def/.endef; ignored"));
coff_sym_addend = 0;
}
- *input_line_pointer = name_end;
+ restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
coff_tag = xstrdup (name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
if (name == input_line_pointer)
{
as_warn (_(".end directive has no name"));
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
return;
}
cur_proc_ptr = (proc_t *) NULL;
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
}
\f
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
+ name_end = get_symbol_name (&name);
if (name == input_line_pointer)
{
as_warn (_(".ent directive has no name"));
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
demand_empty_rest_of_line ();
return;
}
add_procedure (name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
/* The .ent directive is sometimes followed by a number. I'm not
really sure what the number means. I don't see any way to store
symbolS *symbolp;
valueT size;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolp = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
S_SET_EXTERNAL (symbolp);
symbolS *symbolP;
expressionS exp;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
return;
}
- name = input_line_pointer;
- name_end = get_symbol_end ();
-
+ name_end = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = name_end;
+ (void) restore_line_pointer (name_end);
value = 0;
addend = 0;
++input_line_pointer;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
buf = (char *) xmalloc (strlen (name) + 10);
if (start)
expressionP->X_add_number = 0;
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ')')
as_bad (_("syntax error in .startof. or .sizeof."));
else
#if defined(md_need_index_operator) || defined(TC_M68K)
de_fault:
#endif
- if (is_name_beginner (c)) /* Here if did not begin with a digit. */
+ if (is_name_beginner (c) || c == '"') /* Here if did not begin with a digit. */
{
/* Identifier begins here.
This is kludged for speed, so code is repeated. */
isname:
- name = --input_line_pointer;
- c = get_symbol_end ();
+ -- input_line_pointer;
+ c = get_symbol_name (&name);
#ifdef md_operator
{
switch (op)
{
case O_uminus:
- *input_line_pointer = c;
+ restore_line_pointer (c);
c = '-';
goto unary;
case O_bit_not:
- *input_line_pointer = c;
+ restore_line_pointer (c);
c = '~';
goto unary;
case O_logical_not:
- *input_line_pointer = c;
+ restore_line_pointer (c);
c = '!';
goto unary;
case O_illegal:
default:
break;
}
+
if (op != O_absent && op != O_illegal)
{
- *input_line_pointer = c;
+ restore_line_pointer (c);
expr (9, expressionP, mode);
expressionP->X_add_symbol = make_expr_symbol (expressionP);
expressionP->X_op_symbol = NULL;
entering it in the symbol table. */
if (md_parse_name (name, expressionP, mode, &c))
{
- *input_line_pointer = c;
+ restore_line_pointer (c);
break;
}
#endif
|| name[1] == 'T');
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
buf = (char *) xmalloc (strlen (name) + 10);
if (start)
expressionP->X_add_number = 0;
*input_line_pointer = c;
- SKIP_WHITESPACE ();
-
+ SKIP_WHITESPACE_AFTER_NAME ();
break;
}
#endif
expressionP->X_add_symbol = symbolP;
expressionP->X_add_number = 0;
}
- *input_line_pointer = c;
+
+ restore_line_pointer (c);
}
else
{
#ifdef md_operator
if (is_name_beginner (c))
{
- char *name = input_line_pointer;
- char ec = get_symbol_end ();
+ char *name;
+ char ec = get_symbol_name (& name);
ret = md_operator (name, 2, &ec);
switch (ret)
expr.c is just a branch office read.c anyway, and putting it
here lessens the crowd at read.c.
- Assume input_line_pointer is at start of symbol name.
+ Assume input_line_pointer is at start of symbol name, or the
+ start of a double quote enclosed symbol name.
Advance input_line_pointer past symbol name.
- Turn that character into a '\0', returning its former value.
+ Turn that character into a '\0', returning its former value,
+ which may be the closing double quote.
This allows a string compare (RMS wants symbol names to be strings)
- of the symbol name.
+ of the symbol name.
There will always be a char following symbol name, because all good
lines end in end-of-line. */
char
-get_symbol_end (void)
+get_symbol_name (char ** ilp_return)
{
char c;
+ * ilp_return = input_line_pointer;
/* We accept \001 in a name in case this is being called with a
constructed string. */
if (is_name_beginner (c = *input_line_pointer++) || c == '\001')
if (is_name_ender (c))
c = *input_line_pointer++;
}
+ else if (c == '"')
+ {
+ bfd_boolean backslash_seen;
+
+ * ilp_return = input_line_pointer;
+ do
+ {
+ backslash_seen = c == '\\';
+ c = * input_line_pointer ++;
+ }
+ while (c != 0 && (c != '"' || backslash_seen));
+
+ if (c == 0)
+ as_warn (_("missing closing '\"'"));
+ }
*--input_line_pointer = 0;
- return (c);
+ return c;
+}
+
+/* Replace the NUL character pointed to by input_line_pointer
+ with C. If C is \" then advance past it. Return the character
+ now pointed to by input_line_pointer. */
+
+char
+restore_line_pointer (char c)
+{
+ * input_line_pointer = c;
+ if (c == '"')
+ c = * ++ input_line_pointer;
+ return c;
}
unsigned int
typedef char operator_rankT;
-extern char get_symbol_end (void);
+extern char get_symbol_name (char **);
+extern char restore_line_pointer (char);
extern void expr_begin (void);
extern void expr_set_precedence (void);
extern void expr_set_rank (operatorT, operator_rankT);
void
read_a_source_file (char *name)
{
- char c;
+ char nul_char;
+ char next_char;
char *s; /* String of symbol, '\0' appended. */
int temp;
pseudo_typeS *pop;
if (LABELS_WITHOUT_COLONS || flag_m68k_mri)
{
+ next_char = * input_line_pointer;
/* Text at the start of a line must be a label, we
run down and stick a colon in. */
- if (is_name_beginner (*input_line_pointer))
+ if (is_name_beginner (next_char) || next_char == '"')
{
- char *line_start = input_line_pointer;
+ char *line_start;
int mri_line_macro;
HANDLE_CONDITIONAL_ASSEMBLY (0);
- c = get_symbol_end ();
+ nul_char = get_symbol_name (& line_start);
+ next_char = (nul_char == '"' ? input_line_pointer[1] : nul_char);
/* In MRI mode, the EQU and MACRO pseudoops must
be handled specially. */
symbol in the symbol table. */
if (!mri_line_macro
#ifdef TC_START_LABEL_WITHOUT_COLON
- && TC_START_LABEL_WITHOUT_COLON(c,
- input_line_pointer)
+ && TC_START_LABEL_WITHOUT_COLON (next_char,
+ input_line_pointer)
#endif
)
line_label = colon (line_start);
(valueT) 0,
&zero_address_frag);
- *input_line_pointer = c;
- if (c == ':')
+ next_char = restore_line_pointer (nul_char);
+ if (next_char == ':')
input_line_pointer++;
}
}
Each test is independent of all other tests at the (top)
level. */
do
- c = *input_line_pointer++;
- while (c == '\t' || c == ' ' || c == '\f');
+ nul_char = next_char = *input_line_pointer++;
+ while (next_char == '\t' || next_char == ' ' || next_char == '\f');
/* C is the 1st significant character.
Input_line_pointer points after that character. */
- if (is_name_beginner (c))
+ if (is_name_beginner (next_char) || next_char == '"')
{
+ char *rest;
+
/* Want user-defined label or pseudo/opcode. */
HANDLE_CONDITIONAL_ASSEMBLY (1);
- s = --input_line_pointer;
- c = get_symbol_end (); /* name's delimiter. */
+ --input_line_pointer;
+ nul_char = get_symbol_name (& s); /* name's delimiter. */
+ next_char = (nul_char == '"' ? input_line_pointer[1] : nul_char);
+ rest = input_line_pointer + (nul_char == '"' ? 2 : 1);
- /* C is character after symbol.
- That character's place in the input line is now '\0'.
+ /* NEXT_CHAR is character after symbol.
+ The end of symbol in the input line is now '\0'.
S points to the beginning of the symbol.
[In case of pseudo-op, s->'.'.]
- Input_line_pointer->'\0' where c was. */
- if (TC_START_LABEL (c, s, input_line_pointer))
+ Input_line_pointer->'\0' where NUL_CHAR was. */
+ if (TC_START_LABEL (next_char, s, input_line_pointer))
{
if (flag_m68k_mri)
{
- char *rest = input_line_pointer + 1;
-
/* In MRI mode, \tsym: set 0 is permitted. */
if (*rest == ':')
++rest;
}
line_label = colon (s); /* User-defined label. */
- /* Put ':' back for error messages' sake. */
- *input_line_pointer++ = ':';
+ restore_line_pointer (nul_char);
+ ++ input_line_pointer;
#ifdef tc_check_label
tc_check_label (line_label);
#endif
/* Input_line_pointer->after ':'. */
SKIP_WHITESPACE ();
}
- else if ((c == '=' && input_line_pointer[1] == '=')
- || ((c == ' ' || c == '\t')
- && input_line_pointer[1] == '='
- && input_line_pointer[2] == '='))
+ else if ((next_char == '=' && *rest == '=')
+ || ((next_char == ' ' || next_char == '\t')
+ && rest[0] == '='
+ && rest[1] == '='))
{
equals (s, -1);
demand_empty_rest_of_line ();
}
- else if ((c == '='
- || ((c == ' ' || c == '\t')
- && input_line_pointer[1] == '='))
+ else if ((next_char == '='
+ || ((next_char == ' ' || next_char == '\t')
+ && *rest == '='))
#ifdef TC_EQUAL_IN_INSN
- && !TC_EQUAL_IN_INSN (c, s)
+ && !TC_EQUAL_IN_INSN (next_char, s)
#endif
)
{
{
/* PSEUDO - OP.
- WARNING: c has next char, which may be end-of-line.
+ WARNING: next_char may be end-of-line.
We lookup the pseudo-op table with s+1 because we
already know that the pseudo-op begins with a '.'. */
{
char *end = input_line_pointer;
- *input_line_pointer = c;
+ (void) restore_line_pointer (nul_char);
s_ignore (0);
- c = *--input_line_pointer;
+ nul_char = next_char = *--input_line_pointer;
*input_line_pointer = '\0';
- if (! macro_defined || ! try_macro (c, s))
+ if (! macro_defined || ! try_macro (next_char, s))
{
*end = '\0';
as_bad (_("unknown pseudo-op: `%s'"), s);
- *input_line_pointer++ = c;
+ *input_line_pointer++ = nul_char;
}
continue;
}
/* Put it back for error messages etc. */
- *input_line_pointer = c;
+ next_char = restore_line_pointer (nul_char);
/* The following skip of whitespace is compulsory.
A well shaped space is sometimes all that separates
keyword from operands. */
- if (c == ' ' || c == '\t')
+ if (next_char == ' ' || next_char == '\t')
input_line_pointer++;
/* Input_line is restored.
}
else
{
- /* WARNING: c has char, which may be end-of-line. */
- /* Also: input_line_pointer->`\0` where c was. */
- *input_line_pointer = c;
+ /* WARNING: next_char may be end-of-line. */
+ /* Also: input_line_pointer->`\0` where nul_char was. */
+ (void) restore_line_pointer (nul_char);
input_line_pointer = _find_end_of_line (input_line_pointer, flag_m68k_mri, 1, 0);
- c = *input_line_pointer;
+ next_char = nul_char = *input_line_pointer;
*input_line_pointer = '\0';
generate_lineno_debug ();
- if (macro_defined && try_macro (c, s))
+ if (macro_defined && try_macro (next_char, s))
continue;
if (mri_pending_align)
assemble_one (s); /* Assemble 1 instruction. */
- *input_line_pointer++ = c;
+ *input_line_pointer++ = nul_char;
/* We resume loop AFTER the end-of-line from
this instruction. */
}
/* Empty statement? */
- if (is_end_of_line[(unsigned char) c])
+ if (is_end_of_line[(unsigned char) next_char])
continue;
- if ((LOCAL_LABELS_DOLLAR || LOCAL_LABELS_FB) && ISDIGIT (c))
+ if ((LOCAL_LABELS_DOLLAR || LOCAL_LABELS_FB) && ISDIGIT (next_char))
{
/* local label ("4:") */
char *backup = input_line_pointer;
HANDLE_CONDITIONAL_ASSEMBLY (1);
- temp = c - '0';
+ temp = next_char - '0';
+
+ if (nul_char == '"')
+ ++ input_line_pointer;
/* Read the whole number. */
while (ISDIGIT (*input_line_pointer))
}
input_line_pointer = backup;
- } /* local label ("4:") */
+ }
- if (c && strchr (line_comment_chars, c))
+ if (next_char && strchr (line_comment_chars, next_char))
{ /* Its a comment. Better say APP or NO_APP. */
sb sbuf;
char *ends;
HANDLE_CONDITIONAL_ASSEMBLY (1);
#ifdef tc_unrecognized_line
- if (tc_unrecognized_line (c))
+ if (tc_unrecognized_line (next_char))
continue;
#endif
input_line_pointer--;
name = input_line_pointer;
if (!ISDIGIT (*name))
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
else
{
do
}
sym = symbol_find_or_make (name);
- *input_line_pointer = c;
+ c = restore_line_pointer (c);
if (alc != NULL)
free (alc);
char *s;
char c;
- s = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& s);
if (strcasecmp (s, "discard") == 0)
type = LINKONCE_DISCARD;
else if (strcasecmp (s, "one_only") == 0)
else
as_warn (_("unrecognized .linkonce type `%s'"), s);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
#ifdef obj_handle_link_once
name = input_line_pointer;
if (!ISDIGIT (*name))
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
else
{
do
name = xstrdup (name);
- *input_line_pointer = c;
+ c = restore_line_pointer (c);
seg = subseg_new (name, 0);
- if (*input_line_pointer == ',')
+ if (c == ',')
{
int align;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
name = xstrdup (name);
- *input_line_pointer = c;
+ c = restore_line_pointer (c);
seg = subseg_new (name, 0);
- if (*input_line_pointer != ',')
+ if (c != ',')
*type = 'C';
else
{
++input_line_pointer;
SKIP_WHITESPACE ();
- sectype = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& sectype);
if (*sectype == '\0')
*type = 'C';
else if (strcasecmp (sectype, "text") == 0)
*type = 'R';
else
as_warn (_("unrecognized section type `%s'"), sectype);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
if (*input_line_pointer == ',')
++input_line_pointer;
SKIP_WHITESPACE ();
- seccmd = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& seccmd);
if (strcasecmp (seccmd, "absolute") == 0)
{
as_bad (_("absolute sections are not supported"));
{
int align;
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
align = get_absolute_expression ();
record_alignment (seg, align);
}
else
{
as_warn (_("unrecognized section command `%s'"), seccmd);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
}
}
char c;
SKIP_WHITESPACE ();
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& name);
delete_macro (name);
*input_line_pointer = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
}
while (*input_line_pointer++ == ',');
else
#endif
{
+#if 0
if (*input_line_pointer == '"')
{
as_bad (_("unexpected `\"' in expression"));
ignore_rest_of_line ();
return;
}
+#endif
ret = TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
}
++input_line_pointer;
SKIP_WHITESPACE ();
- r_name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (& r_name);
if (strncasecmp (r_name, "BFD_RELOC_", 10) == 0)
{
unsigned int i;
}
exp.X_op = O_absent;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer == ',')
{
++input_line_pointer;
return;
}
- name = input_line_pointer;
- delim1 = get_symbol_end ();
+ delim1 = get_symbol_name (& name);
name = xstrdup (name);
*input_line_pointer = delim1;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
if (default_prefix)
{
++input_line_pointer;
SKIP_WHITESPACE ();
- label = input_line_pointer;
- delim2 = get_symbol_end ();
+ delim2 = get_symbol_name (& label);
label = xstrdup (label);
- *input_line_pointer = delim2;
+ restore_line_pointer (delim2);
}
if (debug_type == DEBUG_STABS)
#define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
#endif
+#define SKIP_WHITESPACE_AFTER_NAME() \
+ do \
+ { \
+ if (* input_line_pointer == '"') \
+ ++ input_line_pointer; \
+ if (* input_line_pointer == ' ') \
+ ++ input_line_pointer; \
+ } \
+ while (0)
+
#define LEX_NAME (1) /* may continue a name */
#define LEX_BEGIN_NAME (2) /* may begin a name */
#define LEX_END_NAME (4) /* ends a name */
symbolS *symbolP;
int temp;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
p = input_line_pointer;
*p = c;
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE_AFTER_NAME ();
if (*input_line_pointer != ',')
{
*p = 0;
+2015-08-21 Nick Clifton <nickc@redhat.com>
+
+ PR gas/18581
+ * gas/all/byte.d: Disable this test. Quoted expressions
+ are now allowed in .byte directives.
+ * gas/all/quoted-sym-names.s: New test.
+ * gas/all/quoted-sym-names.d: Expected output.
+ * gas/all/gas.exp: Run the new test.
+
2015-08-21 Alexander Fomin <alexander.fomin@intel.com>
PR binutils/18257
#name: bad byte directive
#error-output: byte.l
-# The RX target allows quoted ASCII strings inside .byte directives
-# for compatibily with the Renesas assembler.
-#skip: rx-*-*
+# Quoted expressions are now allowed in .byte (and similar) expressions.
+#skip: *-*-*
run_dump_test none
}
+run_dump_test quoted-sym-names
+
load_lib gas-dg.exp
dg-init
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""
--- /dev/null
+#nm: --extern-only
+#name: quoted symbol names
+
+#...
+0+00 T test-a
+
--- /dev/null
+ .text
+ .globl "test-a"
+"test-a":
+ .word 0
\[ 7\] \.symtab SYMTAB 0000000000000000 .*
00000000000000c0 0000000000000018 8 8 8
\[ 8\] \.strtab STRTAB 0000000000000000 .*
- 000000000000000c 0000000000000000 0 0 1
+ 000000000000000[7c] 0000000000000000 0 0 1
Key to Flags:
#...