diff options
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r-- | gas/config/obj-elf.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 08ae853..031fafb 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -406,11 +406,10 @@ get_sym_from_input_line_and_check (void) 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) @@ -1043,9 +1042,9 @@ obj_elf_section (int push) } 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 @@ -1125,9 +1124,9 @@ obj_elf_section (int push) 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); @@ -1319,19 +1318,18 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED) ++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) @@ -1354,7 +1352,7 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED) return; } - *input_line_pointer = c; + (void) restore_line_pointer (c); } demand_empty_rest_of_line (); @@ -1374,8 +1372,7 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) 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 @@ -1391,7 +1388,7 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) *input_line_pointer = c; - SKIP_WHITESPACE (); + SKIP_WHITESPACE_AFTER_NAME (); if (*input_line_pointer != ',') { as_bad (_("expected comma after name in .vtable_inherit")); @@ -1414,10 +1411,9 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) } 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 (); @@ -1767,15 +1763,15 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) 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; @@ -1847,7 +1843,7 @@ obj_elf_type_name (char *cp) *input_line_pointer = '\0'; } else - *cp = get_symbol_end (); + *cp = get_symbol_name (&p); return p; } |