From patchwork Fri Oct 4 13:41:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 98389 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BBFF386D61D for ; Fri, 4 Oct 2024 13:42:02 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id C7A35385E011 for ; Fri, 4 Oct 2024 13:41:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7A35385E011 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C7A35385E011 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728049286; cv=none; b=L4V3CPsIH0zgoh4UPbz0nNv9t3LDg2W86WDaeaLE9amXCjbFGhivyw/pQMfToka43it5+BFzSqZLvjY6DldnbeaFYQHQuyk5GSy5RcuZN7VfHtW5Zb9xcsy6IIyVwCZzsrK2aB+Sw/BeOKYV2jGX3e46OYBxGxna71Nvv/RaXCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728049286; c=relaxed/simple; bh=wbQPrf1744+u82xbor1mGhOQF3B33OeBHdYI6hBfLXA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=nIHiBH6zx29Kh6WkkDxJn9RThhuXZrn28l3LRzjQW0WzoeywMH4+puVO1bsPwBepGzpTQtb1rLyUmojLp+kFp9eznPYfvY6y42S0tyzHuBKbzD9gy8CRskb1hFBpy+efa6CG3OAaiiMnmWCa/oErQ3ktTLUx3hXxk/CBsVF7Lqo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-53992157528so2555657e87.2 for ; Fri, 04 Oct 2024 06:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1728049281; x=1728654081; darn=sourceware.org; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=1rJsIl2mMf0q9ZJwZ42EOPsNM03fD5W9b3Biv0fqN1o=; b=S/fohU+WwzhngehnN2BKhy4/rNHc0/UNv6zONT0PhAqRNljzuQrYpiEzt8nxgUBjLg SfSMWF4HVBMMk0ptCANdJTyDobojAO3fRIt4aqv7JNJcJ48+wwDnS5s4WBqN3EYeYONo FNZveMCr8cS0XllNwOKsaX/oTByL/AaBvnJgNxx68qA6htG8Op3FPSUlYPWL/N5Ypj7y dFZUgkVlU7ygG6bTiIdB7vsW+0WsCgtetMwq3l3Qr1fIDpwPW7iTtXbTghFhjUgHeD39 cT4EghQAPjLMyFb8h96r+8zIFizLMXtwZ2GDanR8PFMiEYtNpYla0KO5CBuZsWN2IEm9 u5EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728049281; x=1728654081; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1rJsIl2mMf0q9ZJwZ42EOPsNM03fD5W9b3Biv0fqN1o=; b=QCtyFGgRHByhGFdy9XyAwzZHQn89NdmORWmIcL/tiju1gohrxAQs0EUes67UZ2HExC a4yiCUDm7Z3ircIsBIWmop99vSlhgYYz5pGwaegFGB+JhlSqYNwwiOjh0cLsP4dkHxcF aB/n4K8Dg7j5P9JYj2OTLipILg/11mwjWr0uDpq9DMjM5yh60AkP7DOX1W9KgL3HI78A wNHpR8fLvj7HmDpuIS4zlQ6/yiaY0cYgPPPXrw3dek0TTkaxqCIg9iCVqPtzvXjW8Qsl uHpiw6CY1aj05xuDMGBQiJ+piy814J70Ao+0DBEz3Bm2IZtkL9p45p+0XgEkR90eSN7+ xNMA== X-Gm-Message-State: AOJu0YyO8LnmvNEn5TbDxaEJyk6xjjPi4JnR+USJI/uzknGIwgSEyEhI ZsZlacJa9JnMF8IpX/Pz/Z6jJ6JC9AvaPH0Q7ZyCNpEFFdpt9YyIOLGljcUZjZvlg/4X2iBqzv8 = X-Google-Smtp-Source: AGHT+IFUkPMiP2rOSQ3nCIOaA1UG4vc8oM9OZrUO8oHzg00JijHHSIwIlUgBzvW1nXuIG1WwycjiIg== X-Received: by 2002:a05:6512:3b20:b0:52c:dbe7:cfd5 with SMTP id 2adb3069b0e04-539ab88ad63mr1711771e87.32.1728049280976; Fri, 04 Oct 2024 06:41:20 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99100a37cdsm230538666b.3.2024.10.04.06.41.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2024 06:41:20 -0700 (PDT) Message-ID: <772312ae-dca7-4010-9318-10c5c9bb1c87@suse.com> Date: Fri, 4 Oct 2024 15:41:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Binutils Cc: Claudiu Zissulescu , Nikolaos Kavvadias , Jim Wilson , Doug Evans , Chenghua Xu , "Maciej W. Rozycki" , Peter Bergner , "David S. Miller" , "Jose E. Marchesi" , Max Filippov , Sterling Augustine From: Jan Beulich Subject: [PATCH] gas: drop SKIP_WHITESPACE_AFTER_NAME() Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL X-Spam-Status: No, score=-3023.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Exclusively all users should use restore_line_pointer() instead, at which point SKIP_WHITESPACE() suffices as a check afterwards. --- Note that this doesn't address the underlying behavioral problem, but merely isolates it to a single place. Constructs (ELF specific in this case) like .size Data1",.-Data1" shouldn't really assembly fine, but choke on each of the double quotes. The problem is that restore_line_pointer() (like also SKIP_WHITESPACE_AFTER_NAME()) doesn't know whether the double quote it means to skip is actually a closing one. --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1150,8 +1150,8 @@ obj_coff_weak (int ignore ATTRIBUTE_UNUS } c = 0; symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_WEAK (symbolP); if (c == ',') @@ -1557,8 +1557,8 @@ obj_coff_section (int ignore ATTRIBUTE_U c = get_symbol_name (§ion_name); name = xmemdup0 (section_name, input_line_pointer - section_name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); exp = 0; flags = SEC_NO_FLAGS; --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -344,8 +344,8 @@ get_sym_from_input_line_and_check (void) c = get_symbol_name (& name); sym = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); /* There is no symbol name if input_line_pointer has not moved. */ if (name == input_line_pointer) @@ -1937,9 +1937,9 @@ obj_elf_get_vtable_inherit (void) bad = 1; } - *input_line_pointer = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("expected comma after name in .vtable_inherit")); @@ -2353,8 +2353,8 @@ obj_elf_size (int ignore ATTRIBUTE_UNUSE symbolS *sym; p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -471,7 +471,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUT c = get_symbol_name (&name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; + restore_line_pointer (c); if (name == p) { @@ -480,7 +480,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUT goto done; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') input_line_pointer++; @@ -1128,8 +1128,8 @@ obj_mach_o_sym_qual (int ntype) 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_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { --- a/gas/config/obj-som.c +++ b/gas/config/obj-som.c @@ -308,8 +308,8 @@ obj_som_weak (int ignore ATTRIBUTE_UNUSE { c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_WEAK (symbolP); if (c == ',') { --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -936,8 +936,8 @@ tokenize_arguments (char *str, goto err_report; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != '!') { if (r->require_seq) @@ -3499,9 +3499,9 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSE /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); /* Alpha OSF/1 compiler doesn't provide the comma, gcc does. */ if (*input_line_pointer == ',') @@ -3746,8 +3746,8 @@ s_alpha_ent (int dummy ATTRIBUTE_UNUSED) /* 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_AFTER_NAME (); + restore_line_pointer (name_end); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { input_line_pointer++; @@ -4316,11 +4316,11 @@ s_alpha_section (int secid) SKIP_WHITESPACE (); c = get_symbol_name (&beg); - *input_line_pointer = c; + restore_line_pointer (c); vms_flags |= s_alpha_section_word (beg, input_line_pointer - beg); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); } while (*input_line_pointer++ == ','); @@ -4938,8 +4938,8 @@ s_alpha_proc (int is_static ATTRIBUTE_UN c = get_symbol_name (&name); p = input_line_pointer; symbolP = symbol_find_or_make (name); - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -1152,8 +1152,8 @@ parse_reloc_symbol (expressionS *resultP return; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); /* Extra check for TLS: base. */ if (*input_line_pointer == '@') { --- a/gas/config/tc-dlx.c +++ b/gas/config/tc-dlx.c @@ -234,8 +234,8 @@ s_proc (int end_p) delim1 = get_symbol_name (&name); name = xstrdup (name); - *input_line_pointer = delim1; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (delim1); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -4199,24 +4199,23 @@ dot_unwabi (int dummy ATTRIBUTE_UNUSED) static void dot_personality (int dummy ATTRIBUTE_UNUSED) { - char *name, *p, c; + char *name, c; if (!in_procedure ("personality")) return; SKIP_WHITESPACE (); 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_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); demand_empty_rest_of_line (); } static void dot_proc (int dummy ATTRIBUTE_UNUSED) { - char *name, *p, c; + char *name, c; symbolS *sym; proc_pending *pending, *last_pending; @@ -4240,7 +4239,6 @@ dot_proc (int dummy ATTRIBUTE_UNUSED) { SKIP_WHITESPACE (); c = get_symbol_name (&name); - p = input_line_pointer; if (!*name) as_bad (_("Empty argument of .proc")); else @@ -4261,8 +4259,8 @@ dot_proc (int dummy ATTRIBUTE_UNUSED) } symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; } - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; ++input_line_pointer; @@ -4494,11 +4492,10 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) /* Parse names of main and alternate entry points. */ while (1) { - char *name, *p, c; + char *name, c; SKIP_WHITESPACE (); c = get_symbol_name (&name); - p = input_line_pointer; if (!*name) (md.unwind_check == unwind_check_warning ? as_warn @@ -4518,8 +4515,8 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) if (!sym || !pending) as_warn (_("`%s' was not specified with previous .proc"), name); } - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; ++input_line_pointer; @@ -4607,9 +4604,9 @@ dot_rot (int type) { ch = get_symbol_name (&start); len = strlen (ia64_canonicalize_symbol_name (start)); - *input_line_pointer = ch; + restore_line_pointer (ch); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != '[') { as_bad (_("Expected '['")); @@ -4740,9 +4737,9 @@ dot_psr (int dummy ATTRIBUTE_UNUSED) md.flags |= EF_IA_64_ABI64; else as_bad (_("Unknown psr option `%s'"), option); - *input_line_pointer = ch; + restore_line_pointer (ch); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; @@ -5159,8 +5156,8 @@ dot_entry (int dummy ATTRIBUTE_UNUSED) if (str_hash_insert (md.entry_hash, S_GET_NAME (symbolP), symbolP, 0)) as_bad (_("duplicate entry hint %s"), name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { @@ -11731,7 +11728,7 @@ dot_alias (int section) delim = get_symbol_name (&name); end_name = input_line_pointer; - *end_name = delim; + restore_line_pointer (delim); if (name == end_name) { @@ -11740,7 +11737,7 @@ dot_alias (int section) return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -1483,8 +1483,8 @@ m32r_scomm (int ignore ATTRIBUTE_UNUSED) /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name: rest of line ignored.")); --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -16509,8 +16509,8 @@ s_mips_globl (int x ATTRIBUTE_UNUSED) symbolP = symbol_find_or_make (name); S_SET_EXTERNAL (symbolP); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (!is_end_of_line[(unsigned char) *input_line_pointer] && (*input_line_pointer != ',')) @@ -17569,9 +17569,9 @@ s_mips_weakext (int ignore ATTRIBUTE_UNU c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); S_SET_WEAK (symbolP); - *input_line_pointer = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (! is_end_of_line[(unsigned char) *input_line_pointer]) { --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2392,8 +2392,8 @@ ppc_elf_lcomm (int xxx ATTRIBUTE_UNUSED) /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("expected comma after symbol-name: rest of line ignored.")); @@ -2492,8 +2492,8 @@ ppc_elf_localentry (int ignore ATTRIBUTE elf_symbol_type *elfsym; p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; @@ -5036,8 +5036,8 @@ ppc_ref (int ignore ATTRIBUTE_UNUSED) 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_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -5912,7 +5912,7 @@ s7_s_score_lcomm (int bytes_p) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; + restore_line_pointer (c); if (name == p) { @@ -5921,7 +5921,7 @@ s7_s_score_lcomm (int bytes_p) return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); /* Accept an optional comma after the name. The comma used to be required, but Irix 5 cc does not generate it. */ --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -4119,8 +4119,8 @@ s_reserve (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { @@ -4246,8 +4246,8 @@ s_common (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name")); --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -800,8 +800,8 @@ tic4x_globl (int ignore ATTRIBUTE_UNUSED { c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_STORAGE_CLASS (symbolP, C_EXT); S_SET_EXTERNAL (symbolP); if (c == ',') --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -1573,8 +1573,8 @@ xtensa_literal_pseudo (int ignored ATTRI c = get_symbol_name (&base_name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',' && *input_line_pointer != ':') { --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -1245,8 +1245,8 @@ dot_cfi_sections (int ignored ATTRIBUTE_ break; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { name = input_line_pointer++; --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1326,21 +1326,21 @@ dwarf2_directive_loc (int dummy ATTRIBUT if (strcmp (p, "basic_block") == 0) { current.flags |= DWARF2_FLAG_BASIC_BLOCK; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "prologue_end") == 0) { if (dwarf_level < 3) dwarf_level = 3; current.flags |= DWARF2_FLAG_PROLOGUE_END; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "epilogue_begin") == 0) { if (dwarf_level < 3) dwarf_level = 3; current.flags |= DWARF2_FLAG_EPILOGUE_BEGIN; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "is_stmt") == 0) { @@ -1442,7 +1442,7 @@ dwarf2_directive_loc (int dummy ATTRIBUT return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); } demand_empty_rest_of_line (); --- a/gas/expr.c +++ b/gas/expr.c @@ -1253,8 +1253,8 @@ operand (expressionS *expressionP, enum expressionP->X_add_symbol = symbol_lookup_or_make (name, start); expressionP->X_add_number = 0; - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ')') as_bad (_("syntax error in .startof. or .sizeof.")); else --- a/gas/read.c +++ b/gas/read.c @@ -3090,8 +3090,8 @@ s_purgem (int ignore ATTRIBUTE_UNUSED) SKIP_WHITESPACE (); c = get_symbol_name (& name); delete_macro (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); } while (*input_line_pointer++ == ','); @@ -4401,7 +4401,7 @@ s_reloc (int ignore ATTRIBUTE_UNUSED) } else reloc->u.a.howto = bfd_reloc_name_lookup (stdoutput, r_name); - *input_line_pointer = c; + restore_line_pointer (c); if (reloc->u.a.howto == NULL) { as_bad (_("unrecognized reloc type")); @@ -4409,7 +4409,7 @@ s_reloc (int ignore ATTRIBUTE_UNUSED) } exp.X_op = O_absent; - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { ++input_line_pointer; @@ -6528,8 +6528,8 @@ do_s_func (int end_p, const char *defaul delim1 = get_symbol_name (& name); name = xstrdup (name); - *input_line_pointer = delim1; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (delim1); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { if (default_prefix) --- a/gas/read.h +++ b/gas/read.h @@ -37,16 +37,6 @@ extern bool input_from_string; #define SKIP_ALL_WHITESPACE() SKIP_WHITESPACE() #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 */ --- a/gas/stabs.c +++ b/gas/stabs.c @@ -453,8 +453,8 @@ s_desc (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0;