From patchwork Tue Nov 29 10:36:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 27161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp254087wrr; Tue, 29 Nov 2022 02:36:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cY9fIdcC32PDDT7XZhXrqQzKGU3VE5B7tW8sqwn0CidW3MS/B5XIngAIP73KpwZHQzgPG X-Received: by 2002:a17:906:a147:b0:7b2:7b45:2cd2 with SMTP id bu7-20020a170906a14700b007b27b452cd2mr47293227ejb.615.1669718195283; Tue, 29 Nov 2022 02:36:35 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hp40-20020a1709073e2800b0078b96068bc0si11925611ejc.79.2022.11.29.02.36.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:36:35 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=GK8mZDku; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F02A33858413 for ; Tue, 29 Nov 2022 10:36:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F02A33858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669718194; bh=xC/GPnJnJyW+ua1kgLMziDR4R2lNLJHN/EyYjlfl/rI=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GK8mZDkuj0k8Uo0RpApFiqUGkOs6cN8T0OL7v78XT7pYfuRZmn+VsH9JWzq4WiGXK pugobo7gxvj0pSDA9rOy+H6ZkXPoOaXDoYQo9Gf2kGaUMctesqhff8Pb+iBcB/CJdg 9ScAWDBbO+fJoYwS0Hu52/BL82qaMvH0IDr2bJ7I= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2074.outbound.protection.outlook.com [40.107.105.74]) by sourceware.org (Postfix) with ESMTPS id AA7FB3858C53 for ; Tue, 29 Nov 2022 10:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA7FB3858C53 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJZAS+rhQdvNFl6z6deiMhKgMwUgl/bpQ0UWX5jNSJ2c3TZpYOfDE8/gR5nnye5zN+HMpydHsW7ODKXDW3iZOGezRczXW9fSZ6HD2l3a56/jxOBVTotSgNQp9PLrfKXpMufq9fPVE4NEik/M3pApMhc9gKNAIDudUMx+Rs4O3nkNpEFo4T6pIJtKEpQX00+bEtmUC516VpHNFGs/UY7L8y+Ok7b17yq1yElRoTdqbcdrEL57M8kTA3AgmyTIRVBD+4kGNJn9LB709u/RHWyVyH60GJmqGB3W4v4F8U1a2e7FtFgDb1Tre5zN7IZpBU6QTT9OTiiiItFhW5vkOSXXsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xC/GPnJnJyW+ua1kgLMziDR4R2lNLJHN/EyYjlfl/rI=; b=eihongtDpLVFLfecsaqRIUQgXInZu8qAmXbXiHYTe21lFPjdWe8gEICSSJJZx/BvoJdyCJliDmpTq5E1xojoJjb8CDU6vcWlDu8TP8K6vSVUIzjVglzvOki+hXBOpVNG1gLsSEdqw4B4oNAWsChCJUOmgbbL2/0uN2/R5DqTbt0zJ5KzhnPbZKw6DcVayfNQIEBnq3aTcyipyfBP+A4lNCTZERhxznnum8J0nxRrtuTP2i2t+NCNZ8z4ZOvwLwT0dd8pvexhHF6/API2IWPhQoqsiijZmuftyD2ft4cU0RPtc3lHehIRBgZCXgXf/JaqU9F7iiC+Ja+5o24QTDFC3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DBBPR04MB7947.eurprd04.prod.outlook.com (2603:10a6:10:1f1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Tue, 29 Nov 2022 10:36:23 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 10:36:23 +0000 Message-ID: <01b77f18-8af3-4128-3645-2f1e05690197@suse.com> Date: Tue, 29 Nov 2022 11:36:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [PATCH 1/5] gas: avoid inserting extra newline in buffer_and_nest() Content-Language: en-US To: Binutils References: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> X-ClientProxiedBy: FR3P281CA0137.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::11) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DBBPR04MB7947:EE_ X-MS-Office365-Filtering-Correlation-Id: 86accf7c-eaa3-4146-f66f-08dad1f58fc3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6AMadLIG1q2quVYw5bRx8Zbx0QvgS9arNdTBYXgvWGxoFysFSR82ND1m9x1D8+4cndJuGGhlHoBkVTOCK7hYp5tb3OcLNATEaPSNtQjTe7ZI8fvdXzwMwMRX9PqfRimHx7OtOGxacNau9Wp6WDZeDmceRD9pRZNcSm4uHJ7ibYGZA8qVQdRYFiY8GkVUD0Loxw4Ae4BOJbHl7y198OkI/dlFS/4lurLkvuYkJEte5MY12MMlRJWtR2Uah0X/a/cJOfEHe+cIDpzdvALFHM2gETAGX1VHB5DVOopKRWpleJnD3IVEgcupI5haphhqLacJtLnEqaIWgdrTpsgWrCIBA9hqBRrq8X579U+mNb6nPMS4AkeJcAv2fMMM7S6LMR3cwSke3CNvpoEkXyiH3ocwmWBPjgCrBZyWMVjk52UxP68e4F0KT+V+2ixgRKDnsAH5D/OMLPHHt1ficd2fQywaYDHPaz5g/1nNCRAHTdxiq1Qv9/xUdSxgZuTlt9XR69Oip07rMbjv+yzTJKRi2aGzYnjM7akGMckLQ+EjGFHfU4up1e2hBgrSsrNeZgd4fSkQi2niOsLCotz8AENugFYF+aABptSNnsdR0l635oqFvrR2xaOQxEzNAPJnyGVcB7VXXEmvjdcqYVv1tkV0I4vuRx77yD5ASpKsVPSqwOYicHDRD4zmVux+8v1uG9PYZlYWcEI/wSksJLzkXoHDq+vyHmE6RIKCBA4cvq1zGWd6AII= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199015)(316002)(6916009)(478600001)(86362001)(38100700002)(6486002)(5660300002)(31696002)(41300700001)(36756003)(8936002)(66476007)(186003)(8676002)(66556008)(66946007)(2616005)(83380400001)(31686004)(6506007)(26005)(2906002)(6512007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WkzL98usb0kbf6r29IMQDXTCxGnX?= =?utf-8?q?WkWO0F6dKoXcMbtrnh/dw8kIX8T4lcuuB0uuELzxJvWNVcwIxmuSscI0pedcaGu8v?= =?utf-8?q?cm9L2wSclaa+1BWfTtpBR97TGyaiAp4tcSsoIvI8zDxBnzDVT3lYAfPgV571p5t8C?= =?utf-8?q?AsaZg0WC8wxQxrQPG0oXU4rt/UxsCRe26Exrf2n8R1VPyEFKiW5hOkrD+a5s69XeT?= =?utf-8?q?9YJkSlmfjRypiwCrwyPt6rdxWSVBVYz8zyp6FtPyaV8dVDGAH70zLZfMXuQj6AVwq?= =?utf-8?q?oQXboV5E/CPXwwXnLgKq74jvvVeK/kDIW/rKRma0XnRTY/LHXRVm4FVaF71n5MVkS?= =?utf-8?q?gbojGjh+HQewlk6PBhNrL/YqYa3jLl4AJfZJezbkTXTqcZ91a5PvcIjwo3hAxHTlI?= =?utf-8?q?NTQ8YlulgWXBg0ivZ0UyeDCdXD/iXPXa0bf6GF7TU0pNzvYbBYUn7PNya/itFvOb+?= =?utf-8?q?U7pEObnSKR9Ny7pszkQoI+pqcST5BtCcoPb/X+zWeJ4oHU0CvEzOUeplJqHQcH3Pk?= =?utf-8?q?D/JnxT8Q+V7K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zSxxRXU46f9v3SWP4BpmAnu4ojKYc7QFGSdZ4fYX?= =?utf-8?q?XZrO0SthCeza9Z57dbltcpXJM9GWFrZFK6HmTlP/58IpcW7nGVAuiP5Bsh9RlFVAf?= =?utf-8?q?ebZfbp3Dld9W?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86accf7c-eaa3-4146-f66f-08dad1f58fc3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 10:36:23.7242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7R0CuYeMzbWqHj7JpPZUhXiL/qHsg82JqV+lckFB4GW3DAMMct2b4Gq5/5jaEL65B7UmLZFA2TE3JU4MRG8hKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7947 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750826426258803654?= X-GMAIL-MSGID: =?utf-8?q?1750826426258803654?= In "-alm" listings I've noticed an odd blank line following the inserted .linefile one. This results from the explicit NL inserted being redundant with the one left in place from the original input line by all respective callers. Note that we need to compensate for the removed line by bumping the directive argument (which in turn is decremented again in s_linefile() before calling new_logical_line_flags(), and I have to confess that when putting together the original change I was a little puzzled by the imbalance of increments/decrements, but then I forgot to actually go look for the cause). While there also switch to sb_add_string() instead of effectively open- coding it to some degree. --- a/gas/macro.c +++ b/gas/macro.c @@ -142,10 +142,10 @@ buffer_and_nest (const char *from, const as_where (&line); if (!flag_m68k_mri) - linefile = xasprintf ("\t.linefile %u .\n", line); + linefile = xasprintf ("\t.linefile %u .", line + 1); else - linefile = xasprintf ("\tlinefile %u .\n", line); - sb_add_buffer (ptr, linefile, strlen (linefile)); + linefile = xasprintf ("\tlinefile %u .", line + 1); + sb_add_string (ptr, linefile); xfree (linefile); } From patchwork Tue Nov 29 10:36:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 27163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp254452wrr; Tue, 29 Nov 2022 02:37:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf7HxgpjMwsudn5i/Jiq5HzWKkOZAh+Sc23SPK2bu2JtW3/Bt8QD7h4+QOw/ktxHzjsbjNdN X-Received: by 2002:a17:906:7096:b0:78c:fda3:c025 with SMTP id b22-20020a170906709600b0078cfda3c025mr38463814ejk.461.1669718254554; Tue, 29 Nov 2022 02:37:34 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bc5-20020a056402204500b0046b2aaf7544si4312243edb.398.2022.11.29.02.37.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=uFksLOE+; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A1A938582A3 for ; Tue, 29 Nov 2022 10:37:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A1A938582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669718253; bh=TSxNy/uqwDH3tYTCb8B3ZAtC0sCP4r7F9/QDQlFI+WI=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uFksLOE+iNT9kNgBkhDGkee5eQXWHtFF0+Grse2M3VD9wOZFAbbNCzxR6BVMQYw2c bx3qcQSkPsNuk9BNTCZEnq3iuq0eQvX1j5ZuIxyoX1JvVqwWU8qrppAtCfPTk4UtNq KoelbVD5nRngn+RMffb2ec/zwwyl7UXSw85FeA9M= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2044.outbound.protection.outlook.com [40.107.105.44]) by sourceware.org (Postfix) with ESMTPS id 788383857835 for ; Tue, 29 Nov 2022 10:37:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 788383857835 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUNIAYunqtmLc0+RGWRMmZNPHMEDuDF2TN6b44DJ74HjhzK7GvJLJ9mxKRqj/tLu2940cEvnnAgOWv4YYnKpyWHWyMfAfq68o5loE84By35a44DY5pkZcptoLC+l5PUh2ECvUDU6SlgiowiAKQRKVswPumFsELJGfRRRYdr1g/tWRS5tKn+k+O2pL2zOINkXGKJM8y4yB8evfgfxtX5XzgIPaMAdFIt1xU6IHYwExa1FaLt3bXIwI4J4jFncqYOPzSbVFM6UWtv2e6y3muBiVG/0XTgCvlr/u+reL7eh9hQdjB5GUXlS1ww/TUGoHX3nd81quhME/rDDKt+mlje2yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TSxNy/uqwDH3tYTCb8B3ZAtC0sCP4r7F9/QDQlFI+WI=; b=PV+RbvVdBTfR7luHMPbM/+ZTzB6bMRDXpAcPkSx+OLFu3Rcq3QmLjGG09UiT59r2OpuSNsLVfqwvYpsqyUHuoZZxMQ8i3SWgxZTYyRf4oopRDherXJbiehKHMvtOxN2GNwqF/poPL0HeRG93kRs7LYK8Z5QuxNKt7YgwHOJRTpOIv4QNRnlrgIYlXs+vBeq/NdZKOuCOZcRiFG/4f5bxZC9wwEcoMmtSXHo0A5FNh8MG0ySfj4lan5tL1f6bZHu45Ui/QNnkq26V97FNY9tYwSKJDHh79sqGNLtrNw3ou02b0tHlI0pJLRWlziRWBPHfCvF6/IuLvzFihCEmxcIXNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DBBPR04MB7947.eurprd04.prod.outlook.com (2603:10a6:10:1f1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Tue, 29 Nov 2022 10:37:00 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 10:37:00 +0000 Message-ID: <2ae84a68-29f3-d94d-1a12-c3d0c81f81a3@suse.com> Date: Tue, 29 Nov 2022 11:36:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [PATCH 2/5] gas: squash (some) .linefile from listings Content-Language: en-US To: Binutils References: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> X-ClientProxiedBy: FR3P281CA0146.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::18) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DBBPR04MB7947:EE_ X-MS-Office365-Filtering-Correlation-Id: 932caf91-e989-421e-46cf-08dad1f5a5dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gT+kOjXvZ4U1jh9qQIqq3It4j5ux4YZR4NbAwemINAZExRw1RESRhTfGZl8ZuI9UTgpXUpJU/S7g5VOK6OyxL0a9bdSW9k5K6buA5tOxvSWO3xbFNtt1JjeM/mu6FMW47Xiys8Fx4oqcNo7wm5kjeEkBAUJQhNyV+IS4VwnzS4KbRnjNy8/Eq/DZaUqOF+ITAYg9XzYKwIhZ+bY+3z1Pj9/CnYE72ybunnuvgkDsSnOtoIGqNQunyn97gjkoRIE6SOU0+WS0EV2BJXLkh2axE33cm32gH8bQ8HEjp1ViTP2vXCZbe+8jEgL1Z5bZyyLa06y24rZTVxfKC+pIOCsZ0mQ+TO+ZtYwwFcJNF/Bb2UM6PS3usW5IRA+rzI3g4w3pElvvHVy00+l47t2oS2eCvOnIaeacpOFOp7j5M4p8NSt2/JQjh1IQiMuqeuOm+3fkNELj993Fh9xaCdCb3OG4oshbfms3nZb2Cuwtuf2Jg1OkFzmRcvMSjSsJkf9nJKjkb0dJMrLCuCYj+jn9PkMIbVdPtnTZhQikOPemwTOHSDJ6ti5+X7RVEa26QGOL/4jnkXc1Wx2ZN6bNVoWCduVX/xzeLP71el2KdxgkBPAQJ0qkF41BWXbwuxX1RYqRq/XEuVHjF6PQE6dh+lh1RFJ3Y3LJk6ji15wV8HBZ8YLKY5Ij24bJUpTe7iZ4965qOejdyEk2jxBVeS3gtRkUS3TzKPbUQZZ1PzcNyG+YwETLhR0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199015)(316002)(6916009)(478600001)(86362001)(38100700002)(6486002)(5660300002)(31696002)(41300700001)(36756003)(8936002)(66476007)(186003)(8676002)(66556008)(66946007)(2616005)(83380400001)(31686004)(6506007)(26005)(2906002)(6512007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vFUAFB6Rvibi55gdX5fwvaZRzLnD?= =?utf-8?q?ysAjvHjnNvKXNUifX4u3Nuuy1nGmcNiDL2ZKsl6fLe+5s2lQWJftw4WBuX/kWxmFd?= =?utf-8?q?oreZbTlf8RF998VI+F87Z0F9dyAdzAas7FXie6i+2gjlSAo5bNalRIgCAWRQGGTcd?= =?utf-8?q?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?= =?utf-8?q?ig0TSDbFPJ4UPeQo5aZrNdXjakyZkTPlm5pr0re9ci5zWiFu9k/NAGV6WcJ8EDuAW?= =?utf-8?q?NbJqnJVBeWwiYEDwZV5EIU1b0Cgne+CO836RH82Xavld36JMUrX8Dkb+v12575ts7?= =?utf-8?q?oHBAL4IvdUAeEDjvSJkSWXDZhETb4E/9i9qFRKW8zLirh6IsDOwrW8+DrdQk72BEC?= =?utf-8?q?xo6lTuVZKL2upolSYJBcgw8jjwKKQdO26MqmDLtkaMZT4o5mn/Vl/rTfzMFu/10ZS?= =?utf-8?q?vDvPmXNnVwXM0H4Hhp9z2wCCgjbSxOcYkje4aKfPZmj//h5G6BVd7Q3n4Z7D+74LP?= =?utf-8?q?6TiSO/Ol7Sd5BnjX5IoHPwLnSULDznOiMCH3ghMPVwgLOpjqIBgXeyxjEsGRQYyaa?= =?utf-8?q?9YvhVOuVcdciDyhMbLZviirW+2QfaHLay9P1daQLUI6ZKoUW4my4BZGdcBOX2Ee+n?= =?utf-8?q?HZW6bQ6ja3tNNH1PDbc0xAwuP1cklAY90NMI7XzJK1pQi6kh9IkFtSRs4sLLmnESZ?= =?utf-8?q?sSCbIlXDF5hH?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 932caf91-e989-421e-46cf-08dad1f5a5dd X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 10:37:00.7531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RNxoLk4wo/5ml8KvFiZhDuCKh9g2CvkbnvIrvEYCjO1hiDqY/g/m4wFVBj/vwa2wKNQSjaOsjGqPN1FgJehGfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7947 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750826488114531390?= X-GMAIL-MSGID: =?utf-8?q?1750826488114531390?= Not so long ago we started to insert these artificially when expanding certain macro-like constructs; zap them as cluttering what actually results from user input. --- We may want to also zap ones resulting from "# ", albeit these anyway appear in listings only when assembling from stdin. Such zapping also would need to happen elsewhere and/or in a different manner. Slightly RFC: Am I at risk of zapping a label named "linefile" this way? (At least we can assume that this directive is the only think on a line, _if_ it is a directive, for being internal only.) If so, lifting buffer_and_nest()'s respective logic into a helper function may be the way to go. --- a/gas/read.c +++ b/gas/read.c @@ -867,7 +867,10 @@ read_a_source_file (const char *name) /* Find the end of the current expanded macro line. */ s = find_end_of_line (input_line_pointer, flag_m68k_mri); - if (s != last_eol) + if (s != last_eol + && !startswith (input_line_pointer, + !flag_m68k_mri ? " .linefile " + : " linefile ")) { char *copy; size_t len; From patchwork Tue Nov 29 10:37:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 27164 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp254597wrr; Tue, 29 Nov 2022 02:37:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ol7cqTnyfzr6QZVruIpcPORobh72+m0DajlgHYiFVlA1pj3/UxP8Z+aw/dcwCQRTutyit X-Received: by 2002:a17:906:4e47:b0:7c0:8024:c2be with SMTP id g7-20020a1709064e4700b007c08024c2bemr4812859ejw.68.1669718277422; Tue, 29 Nov 2022 02:37:57 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p6-20020a056402500600b0046b2d74c08csi4483433eda.38.2022.11.29.02.37.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:37:57 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=oR26jXHN; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A3E8385514C for ; Tue, 29 Nov 2022 10:37:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A3E8385514C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669718275; bh=BMCkCGZ4Etq+1lgU7VL/dy8HKxYh//UGzi9qs0hE3oc=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oR26jXHNRg1pGwTzCAOR24r0KW3E8dBA56NOPpnRbrJVliKpRHuNpMmT8cNdx72U7 vt8a4S2K6G+yZuJsJ0onJoKvcGZj4XFw2XRTa8E2uwW4UPoMUsj9vv4nok7qHpCEKx 4GsWw0I+2KsrMfXQrX6k0pQpOn6FtgPEHlCBow4E= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2059.outbound.protection.outlook.com [40.107.7.59]) by sourceware.org (Postfix) with ESMTPS id 2584A3858039 for ; Tue, 29 Nov 2022 10:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2584A3858039 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/jmFykwjz8LzzwgxpvmUUgUfBmpjOUOJY2KDOZkiu0ZND8mINaPRus3lYv7vtSliT3uReMlIV5oVKkyLejVl6Ii8BjHMhmNxhGmGzo79adSANP8bB7bJYyYIzOsW20DzofJx6c25gpJDcXHnWWbXl0dR8EfZrkkeL5MQkkEdlan63Fg3wqv/Roy9z7WJhUvLNQ74bH0TwGVUJI47Xa2fJO0+WavA7kgkOCu6tPQKhSyLjS1qjFfyL2w9Cc+9TLGKaQ4zZzHcld7hdUrWlZS2rlzioMlKitTx3y4Vsy+OvOFp79cMUeqnsJzNWP7xx2/0nBMij1fvvcVFoeraSDLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BMCkCGZ4Etq+1lgU7VL/dy8HKxYh//UGzi9qs0hE3oc=; b=LxuPL0xhRm3PYtLIWQC2beUupXFS4NrX/xe4BjMtFZtE8cZFK/rBVsWa0ihdmmPvThHjFHbmmu86CnRW5jK9y7r9Rs0Mws+G0qAV08hTZ9vNn7OIH9yduj0hDELG6gVpHk1jhYKkd9Jj4QL49E4CMPpwUFa7rBG2MU3fPVnPsB9Sd+q7QzDNH7g4bae+khQEVc0RvqOYbe894D/d5rTK6VjoNHc0+FVSBMpEg8B2Rp5HPYm+4xWEYrTPFCYKvMs423/eFF0CG5XGK5f0H63G8ERrsOCTnR7K+IKEj1oWjm8hmhZWjk/txDI4lXvAainJPLkTc9+ZNVjQzCE5obYo5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AS8PR04MB7703.eurprd04.prod.outlook.com (2603:10a6:20b:23c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 29 Nov 2022 10:37:44 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 10:37:44 +0000 Message-ID: <8b41d62d-8345-a2bd-ce90-27d79aefe2eb@suse.com> Date: Tue, 29 Nov 2022 11:37:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [PATCH 3/5] gas: add Dwarf line number test for .macro expansions Content-Language: en-US To: Binutils References: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> X-ClientProxiedBy: FR0P281CA0005.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::10) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB7703:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f213f8a-57cf-4b64-9691-08dad1f5bfb2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rzXEo+lZNsxzjhW7DjEHWGG7eWVF6yjzu2tR0O9nx9854KSfZHRlONH0H63xjSM1ZdA9FQDoRSUISpGZXE5KeNuoCflLPeLYqdvTcbVH+q5nsAhO2KJR+UuEqm0lq2BPVtCKALU0SrWkgKDH9Qx4Y6/aZ9joD9D4S8XxUDXyhZf/zaqKCXweQyFumvdYqNyVq5GyBHFASULWFKCoErGm9VeYwKEnSSehufQD17QlrKTHF89h1+GaSQEgChd5QQdNvNvJfrmySOSG9gvKdTr0IMhn+OEmzyron5m/aAC0t0f6rvBIxvXmpz8AZqXfCzrnFLN4BNrgO7uIBPQ6TENwsPXZtgBOM2spnbTksUc2DWtyJHA+FdXRAD3x0w2YFHorOPDlLaRcbob4CTisNTJhJ8WYhVgNuoDdDfB17QncYxbQt/h8EF8OgC3TD/4pqWvzh3le8I6XBzuf05HWDa8u5MlCySH7i5tcIkg8wzA4c+YzusQBxDJds1atdqwFGPKflNZpp8hLRYJ1/ny7y+QDjbCTsBXEAGwgKbL057rBDne3jH6aibxljpUTdMYxTF9gqReohiaU86eaVpxUpu/emmn7mcGojNqfPPSnDLVRLWTcJ8ARlgDEQ0rFwHUibyU5A5AACybjw/mxVaFwoBrsYzG8VHjtxNDRAB8+o83GP8Ijtl0LQ0iF6ma9a0SFMKDKcW7dmkNfA5vTRFxe2TU22m33Ydor7iXRNZsK2TyWupNSpfOPLyMCbEdlw1co1fu X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(346002)(376002)(396003)(366004)(136003)(451199015)(36756003)(6486002)(26005)(66556008)(6506007)(38100700002)(6512007)(66946007)(478600001)(41300700001)(8676002)(66476007)(86362001)(31696002)(316002)(6916009)(5660300002)(8936002)(186003)(2616005)(31686004)(2906002)(142923001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?N/SFOiXccH5v0uS7xQqNKzJXztRV?= =?utf-8?q?xp/Zv0qJYTqIoAYHuyNqXeklhMwjhkytCuVwtUQBJikWaTrPT9ktkMAbVftAbPeZU?= =?utf-8?q?1OZp3M4P3nvzqhri/x7XVjg9migUZ/+FGWXEpaa6KH7UX/AHTYhm6qq07Ii9NPoTe?= =?utf-8?q?NpL/9PdFFr8/9xDkuBFux2Mm1ZEttPryxZfwqJsMWuOuV3LUMYvJhID36ypff4PfT?= =?utf-8?q?nUJjAisDNVk6fpFQvFgFAb5tDAXLlSb/SZCRL0BslWuZBAZ9FacIRiWkX2cFkqvrJ?= =?utf-8?q?bkp3KQMYztgIAAgKPY4xWxKSEkRt8sXgWV7hucob2aqzpUxzRpdHkBqc753MpYpkF?= =?utf-8?q?RCCEtLqvc6Yn4bQ35ZFNlUjl6aHgLvC9dKkpCzWMfmQBGu8y4xRUNHEUMvBuNofAH?= =?utf-8?q?Pl6exXgCvXdFH/4oA0S46QvCtctQo9lvrP9Dc8G/y8MxK6n01gcHMjW+P3oo608jm?= =?utf-8?q?b1ISDkHv6qgWQTe16z+4FtmOjnJZWQSjuotprjwhE8CYinusU5We2VAOeHxMOqUlM?= =?utf-8?q?nV0sTEBcy7HXSMByTYKHv5nh8olKqx19H7vRqfsEzsb9tsZF2iyTCabfzyM9XFoGQ?= =?utf-8?q?WCjbq//4QARV3VRKb+Zcy6PoX2BPdawW76TDLVWLSQhaTDXRfMOfPPuXkjMRu3hJv?= =?utf-8?q?hRFwvIoL2oCXhwttLM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.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f213f8a-57cf-4b64-9691-08dad1f5bfb2 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 10:37:44.0785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Nzxe8w43Y2K7Vd5BHQYRhLrvd3u69MjTwpXy8UYoNIxNo3xeUnudHSqKPHiC4YYus8CGSFYPpW2nCRq6rv5+4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7703 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750826512568836425?= X-GMAIL-MSGID: =?utf-8?q?1750826512568836425?= Before fiddling with the code let's put in place a test covering what PR/gas 16908 aimed at. --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf-5-macro.d @@ -0,0 +1,27 @@ +#as: --gdwarf-5 +#name: line number entries for .macro expansions +#readelf: -W -wl +# The am33 cr16 crx ft32 mn10* msp430 nds32* and rl78 targets do not evaluate the subtraction of symbols at assembly time. +# The d30v target emits sufficiently different debug info, apparently also covering padding it inserts. +# The riscv targets do not support the subtraction of symbols. +#xfail: am33*-* cr16-* crx-* d30v-* ft32-* mn10*-* msp430-* nds32*-* riscv*-* rl78-* + +Raw dump of debug contents .* +#... + Line Number Statements: +.*Extended opcode 2: .* +.*Advance Line by 10017 to 10018 +.*(Copy|Special opcode .* Address by 0 .* and Line by 0 to 10018) +.*Special opcode .* and Line by 1 to 10019 +.*Special opcode .* and Line by 1 to 10020 +.*Set File Name to entry 2 .* +.*Advance Line by -10012 to 8 +.*Special opcode .* and Line by 0 to 8 +.*Set File Name to entry 1 .* +.*Advance Line by 10018 to 10026 +.*(Advance PC by .*|Special opcode .* and Line by 0 to 10026) +#... +.*Special opcode .* and Line by 1 to 10027 +.*Special opcode .* and Line by 1 to 10028 +.*Advance PC by .* +.*Extended opcode 1: End of Sequence --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf-5-macro.s @@ -0,0 +1,28 @@ + .macro m1 args:vararg + .nop + .endm + + .macro m2 args:vararg + .file "Line.s" + .line 7 + .nop + .endm + + .macro m3 args:vararg +# 10013 "line.S" + .nop + .endm + + .text +macro: + m1 1 + m1 2 + m1 3 + + m2 1 + m2 2 + m2 3 + + m3 1 + m3 2 + m3 3 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -308,6 +308,7 @@ if { [is_elf_format] } then { run_dump_test "dwarf-5-cu" $dump_opts run_dump_test "dwarf-5-nop-for-line-table" $dump_opts run_dump_test "dwarf-5-irp" $dump_opts + run_dump_test "dwarf-5-macro" $dump_opts run_dump_test "dwarf-3-func" $dump_opts run_dump_test "dwarf-5-func" $dump_opts run_dump_test "dwarf-5-func-global" $dump_opts From patchwork Tue Nov 29 10:38:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 27165 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp254992wrr; Tue, 29 Nov 2022 02:39:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf5iyuIJ53iDnWrhVdVmIWFSl8QsDkY22EaoPkpTPOxum9G4+GGZ28ChlLCNTszR+rZSCits X-Received: by 2002:aa7:d88c:0:b0:468:ffca:6982 with SMTP id u12-20020aa7d88c000000b00468ffca6982mr48582250edq.282.1669718346313; Tue, 29 Nov 2022 02:39:06 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hr28-20020a1709073f9c00b007bedd130080si5811598ejc.231.2022.11.29.02.39.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:39:06 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Rfx8WC8F; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22E3D3857C48 for ; Tue, 29 Nov 2022 10:39:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22E3D3857C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669718345; bh=nzzFLhs+MA/7tszi9W44piEEKFO0StqsG1rWw1vfmrY=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Rfx8WC8FZeq9cupY72jYzrdvY1AjAQeF8/fxdydXaAxWNPRUNK49vEAvH6G4onzB4 EeRwhkBDfxUZHPKgWmKVyjKFiQ+WF7hUVx0GLGFgfRnjeU4IVihItoudm0ng5bDZIc 0i27rDxqTisINiul3ArEfhYu+l0lW6viyK7WqjkE= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2060.outbound.protection.outlook.com [40.107.104.60]) by sourceware.org (Postfix) with ESMTPS id D90D63858413 for ; Tue, 29 Nov 2022 10:38:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D90D63858413 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kwELd8aTxM524GLaAU1efs/Y0NfMhaF/W7P+fjbf4bgmQ4NoUy/KXF/Ct6HfQSFav6tI4iUVy27TtLrzjVuPT3a/ccHFnXQOFAmerXPpymmFP74aGbt3JQMftCx7UmSLJlJYdPTVCvBB4hH159wXv+y+2qjZIxFVgBnJKQSGprgodsJaBnbIf2Xydf2qaGvikAyKVHWC7EFnNFk/+C/Re+Jd8kZ3Lw1iOchrIISngXxJ1PCwYXKQoM+ouGWAilY+UNM9NHKw7YRXNMdAaojhYpOLT09dsaZq6EkJCZT47fyjKnyek3ExD2n94jUURt3Uiv1FaSWYYy0cgyzAK2JWhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nzzFLhs+MA/7tszi9W44piEEKFO0StqsG1rWw1vfmrY=; b=F0dwjs56H3+xetFCztJsihV3Z0swJJz7mgYlJQHMUEXiEGTxeMquihX+S6tDgB+b1XPcFMgVLjW0bPhhyaxF3GSFdKOeY/NuS4kbMQZlbHqGfoQ2xLSdwYlq+e+k3e2RayMI1Uxtom1hiENDrjAt0sqpMzP+J6JPwMFf995oT2UDnD8hxfVUTVJz1Ar0meIZotBDoPtErcAaXpL1oOaFvQJ5a0E4pb4m1t83I/rncsPy8KKzeSw11fOc6BG64256EfCqq1L19nBqTU+kpI9bXnS/qUI0q+TCHq1pWrHffcc/CvlQoc1JQA0BO0mu8nWwp7/H2kUoPPyHho+LX1mcvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DBAPR04MB7336.eurprd04.prod.outlook.com (2603:10a6:10:1a9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Tue, 29 Nov 2022 10:38:54 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 10:38:54 +0000 Message-ID: Date: Tue, 29 Nov 2022 11:38:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [PATCH 4/5] Arm: avoid unhelpful use of .macro in testsuite Content-Language: en-US To: Binutils References: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> Cc: Nick Clifton , "ramana.radhakrishnan@arm.com" , Richard Earnshaw In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> X-ClientProxiedBy: FR2P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9a::17) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DBAPR04MB7336:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e50c3dd-fee1-41e8-f9b3-08dad1f5e976 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h9xYimTk90VPT72hUJnS6Jc+HfqbxbZWYoEU4t2L4SF/Wf3OkdgD4bXHCn7w/2A6ho9giEsFHXUdo/cSFDcp0huHx0L1f/+Wj7nE5oLVMlMOYWaBOcC1LUQph2crgFvdx7ZrDurnC7SQQdcV/LM+6kjEi4BQkzzBCvdxLymENhlyhP33kylRC+eZ6w1vfL8rKILNvZ72AwhAhhzP0qkqcgMZB86OLn57yYGrR7bbPK6Ugni0CcKidn+sOHM+4cwSFTc5iAicoiTVfTiElTPEXZFHzENTupJcTpI2cK10CxwfLZIOE4X28oPly5+HjFfa3hMyoX7ROnbmfx/ywig00qKK/PlaTe/LbOeyKzdCunGPYWpNgxEgCkS2eFIKi/M9CCTQXEpYoPaFrdz9ZVQxJY26tkog3Jrpz5Mb8NiwlVlgXJpJzRu8kVqgJXOgz1d2eAREZsVLEO2p22w5HuU4V1bclae+kS0mvydj8iiC0Hnqn28cM4oeVeZ2MrMNeObTApmYCHUy8e5uZ2zZq589buC1hExSDgyKhFhXUn9jpuIw1QcpyutqrKI8+MVEAVvz/4MNpAZhtbjxWStOB2t1mzCR32JfD7B7LWzZdAAFFRuO5SL3ywZXisfFX74MV1jMxhLxK8PFQaM6QTnLo/Yi7efvwOuOMkHnuO5rjwEWsJjAZkZJjLRuvGN8jQYYgpMk5egw1YmQ7NiA84WBwWX7WHqnaPTP3HiwaxoufMbgmQWK/+KL3PpBFdc96PN2g+7/gJ4xjYTpdrftVoB9cUmUJg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(39860400002)(136003)(396003)(366004)(376002)(451199015)(31686004)(41300700001)(66946007)(83380400001)(86362001)(2906002)(31696002)(38100700002)(54906003)(316002)(6486002)(6916009)(8676002)(66556008)(2616005)(478600001)(66476007)(36756003)(186003)(4326008)(8936002)(5660300002)(6512007)(26005)(6506007)(142923001)(43740500002)(45980500001)(357404004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?/g/iFwFMmTCI0SuBpN1F57efMAhd?= =?utf-8?q?+B86FXdIpzQRH1VfBnFBPnAA5cM693iKgk7E2dVtSSwT7OOyzgMa7G7q/GAdOOVRp?= =?utf-8?q?piCG0snoqfAjz6UpJEQkacfgpMZ7bct951XNE7bMUkyUcq1MChVJdCliVmo29w/Hi?= =?utf-8?q?y/hReAWqcVGO5xFWKhNVzxLND2kpHk833CxMBM3LxbsJwG3Dbdv21v7SDe6SmLVhX?= =?utf-8?q?YeUPZwW8xtvi487SZMias8pohXi4BT7zXgpP34IM31T1dzDmj8n5ZYuneP6k4tp2d?= =?utf-8?q?s/HYKOH0G1Re/NrMRjlIDCjeQ1UrHxWFZ4xFj2pzdcD/yenw6ZH2sHOIWOhcTt7VM?= =?utf-8?q?Gw4MCI6YF7XGGkh4esVIyB1l3c+RaKxHAoLTtIEK5NqHaoKquW8BChyffu09TRwmY?= =?utf-8?q?oMA1TlwJ+f/i79GNXQZE6Msf7kCKuGAVZDUHUQExhOAUA5kL0PwR9xZH4/qSZYcnc?= =?utf-8?q?tkQUehDU9dYasjTWk3vJMG2D3PEzBdxDeneKPIqOgFUNSgHZ70wGAEE44z1B9Z9O7?= =?utf-8?q?v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dnUo?= =?utf-8?q?At+OgHB64JBzbySspRUvsF4K2WGK3GRWY913xjSDcIb1X7jucE3CGpminZwtVH4ib?= =?utf-8?q?X4KsQh3Vuct/xNR4PaYY1GDgQCXVHT1mPTiNE/G/56FimxIotdF6jFX/xPZyzDl5K?= =?utf-8?q?6gSNN9U0nVgV?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e50c3dd-fee1-41e8-f9b3-08dad1f5e976 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 10:38:54.1365 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u4BvDbZgeCUTUqncyT2uqrrND/yiI9WRc6qZiL6LY+izUOAezDQAOigt5kFJN5jB+jXWS/THmDDGJP1jqTXeZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7336 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750826584755853794?= X-GMAIL-MSGID: =?utf-8?q?1750826584755853794?= Macros with just a single use site are a little pointless to have. Expand sp-usage-thumb2-relax'es inline, avoiding the need to touch the testcase when diagnostics for code inside macros are changed. While there also make what was "iter_mla" cover smlatt as well, rather than testing smlabt twice. --- If this removal of the use of .macro is deemed acceptable, I'd like to extend it to some of the "[Bb]ad MVE ..." testcases as well (see also the subsequent patch). --- a/gas/testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.l +++ b/gas/testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.l @@ -1,17 +1,17 @@ [^:]*: Assembler messages: -[^:]*:25: Error: r13 not allowed here -- `add.w sp,r7,#1' -[^:]*:25: Error: r13 not allowed here -- `sub.w sp,r7,#1' -[^:]*:25: Error: r13 not allowed here -- `addw sp,r7,#1' -[^:]*:25: Error: r13 not allowed here -- `subw sp,r7,#1' -[^:]*:26: Error: r13 not allowed here -- `bic r7,sp,r2' -[^:]*:26: Error: r13 not allowed here -- `sbcs r7,sp,r2' -[^:]*:26: Error: r13 not allowed here -- `and r7,sp,r2' -[^:]*:26: Error: r13 not allowed here -- `eor r7,sp,r2' -[^:]*:27: Error: r13 not allowed here -- `smlabb sp,sp,sp,sp' -[^:]*:27: Error: r13 not allowed here -- `smlabb r0,sp,r3,r11' -[^:]*:27: Error: r13 not allowed here -- `smlatb sp,sp,sp,sp' -[^:]*:27: Error: r13 not allowed here -- `smlatb r0,sp,r3,r11' -[^:]*:27: Error: r13 not allowed here -- `smlabt sp,sp,sp,sp' -[^:]*:27: Error: r13 not allowed here -- `smlabt r0,sp,r3,r11' -[^:]*:27: Error: r13 not allowed here -- `smlabt sp,sp,sp,sp' -[^:]*:27: Error: r13 not allowed here -- `smlabt r0,sp,r3,r11' +[^:]*:7: Error: r13 not allowed here -- `add.w sp,r7,#1' +[^:]*:7: Error: r13 not allowed here -- `sub.w sp,r7,#1' +[^:]*:7: Error: r13 not allowed here -- `addw sp,r7,#1' +[^:]*:7: Error: r13 not allowed here -- `subw sp,r7,#1' +[^:]*:11: Error: r13 not allowed here -- `bic r7,sp,r2' +[^:]*:11: Error: r13 not allowed here -- `sbcs r7,sp,r2' +[^:]*:11: Error: r13 not allowed here -- `and r7,sp,r2' +[^:]*:11: Error: r13 not allowed here -- `eor r7,sp,r2' +[^:]*:15: Error: r13 not allowed here -- `smlabb sp,sp,sp,sp' +[^:]*:16: Error: r13 not allowed here -- `smlabb r0,sp,r3,r11' +[^:]*:15: Error: r13 not allowed here -- `smlatb sp,sp,sp,sp' +[^:]*:16: Error: r13 not allowed here -- `smlatb r0,sp,r3,r11' +[^:]*:15: Error: r13 not allowed here -- `smlabt sp,sp,sp,sp' +[^:]*:16: Error: r13 not allowed here -- `smlabt r0,sp,r3,r11' +[^:]*:15: Error: r13 not allowed here -- `smlatt sp,sp,sp,sp' +[^:]*:16: Error: r13 not allowed here -- `smlatt r0,sp,r3,r11' --- a/gas/testsuite/gas/arm/sp-usage-thumb2-relax-on-v8.d +++ b/gas/testsuite/gas/arm/sp-usage-thumb2-relax-on-v8.d @@ -21,5 +21,5 @@ Disassembly of section \.text: .*: fb1d b023 smlatb r0, sp, r3, fp .*: fb1d dd1d smlabt sp, sp, sp, sp .*: fb1d b013 smlabt r0, sp, r3, fp -.*: fb1d dd1d smlabt sp, sp, sp, sp -.*: fb1d b013 smlabt r0, sp, r3, fp +.*: fb1d dd3d smlatt sp, sp, sp, sp +.*: fb1d b033 smlatt r0, sp, r3, fp --- a/gas/testsuite/gas/arm/sp-usage-thumb2-relax.s +++ b/gas/testsuite/gas/arm/sp-usage-thumb2-relax.s @@ -1,27 +1,17 @@ - .macro iter_addsub + .syntax unified + .text + .thumb + .global foo +foo: .irp m, add.w, sub.w, addw, subw \m sp, r7, #1 .endr - .endm - .macro iter_arith3 .irp m, bic, sbcs, and, eor \m r7, sp, r2 .endr - .endm - .macro iter_mla - .irp m, smlabb, smlatb, smlabt, smlabt + .irp m, smlabb, smlatb, smlabt, smlatt \m sp, sp, sp, sp \m r0, sp, r3, r11 .endr - .endm - - .syntax unified - .text - .thumb - .global foo -foo: - iter_addsub - iter_arith3 - iter_mla From patchwork Tue Nov 29 10:44:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 27167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp257122wrr; Tue, 29 Nov 2022 02:45:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7YrFv/hmSEVD0pkJvgs4wTjeE6G3zImrwSyNNuYvd1rchZ4UGAEs9pAEg9zPBPsaUep7Uy X-Received: by 2002:aa7:c841:0:b0:45d:2a5:2db8 with SMTP id g1-20020aa7c841000000b0045d02a52db8mr36346376edt.105.1669718715550; Tue, 29 Nov 2022 02:45:15 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hs15-20020a1709073e8f00b007825bd02a6asi11868768ejc.54.2022.11.29.02.45.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:45:15 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="asTP+0/5"; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BDF13858D39 for ; Tue, 29 Nov 2022 10:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BDF13858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669718711; bh=DwiadoooEHz2ShOze6QfLeymIjhxvk6DcSm8dlR6w5M=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=asTP+0/5Tk5xjtqCYmuZKVwmim+KSxbk49XWSsY8cfaF8Y4lwsSEGR+CnQUHfntoR Vz4E9Bk+w5gxmfCq4rgN9uH7rTVYRClRsGO9lSs7y42it3tZH79uLegEVA1CCGL2/X 4L7OwuOFOiEtnM5tBLwFhjVwiHK1vjHT7J4856f0= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2070.outbound.protection.outlook.com [40.107.14.70]) by sourceware.org (Postfix) with ESMTPS id 8BEB93858D1E for ; Tue, 29 Nov 2022 10:44:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BEB93858D1E ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EEoaa1CBdJf2Z1YEF2e2wkVJxW6JMezAGl8nCsD+nSTfGG7b7YY7Fm1Eb2dVptnlA7hL4DbjCwKDla5YWhTiHwn1eBso2yveysw3SK2TjaH9G8YiqSQ8RUy7LzmdCUThPfrsx35T+M7cveGXKjU1yOphx+FUoWi+OCt/puZuLyv8nyU4zVqMdR14H+G1oIQVXsDbVj3qoKfwd0wYVv0+qVWXwFBVQOhCUtCSm0vIKTwiBG8cG4suFFEhzptmBus6rmDSy/b/TogXWloIzMikpqGulXo02cV9G/JVCJrvMr/1dMwD5ez/ZAdUeJmRF/ibbVsu0ZhI6/vP2sHcXAmm6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DwiadoooEHz2ShOze6QfLeymIjhxvk6DcSm8dlR6w5M=; b=Xl5fAyXRv//j0qIJxx4x3QGzyW6T9zxcUYPo/woQvYJ4RRaDvcyU1rvLcmatf3AkeaqcLDfdutDOMTPnpLcN/4MvRyrdbb+J1zJ/+cm+zkwMqWVvZ6BYQMZtbnP0WI4XoopQIwkr/GV5axTmBJ/4VIiSNUC9kP3tyWPcLh6pHUdnX9uBS02QTFAVK6X47t3Z+4m1Eh6w5ymj8kKR27vCdvGhgMtxAnwniUKKahwTPcp4yiqg/bQiJgAQR7F005aKEPFzLKKUy++WXCn68yO0eA4yeeq+rEfO2t4OK3jl1UBk0xhRSXL87zx9h/+kCWmSkRRHNeUsvIlwerRsRbmehg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PAXPR04MB8831.eurprd04.prod.outlook.com (2603:10a6:102:20e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Tue, 29 Nov 2022 10:44:53 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 10:44:53 +0000 Message-ID: <1c75f3b4-14ac-fa39-fac8-2c98b4c4dbab@suse.com> Date: Tue, 29 Nov 2022 11:44:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [PATCH 5/5] gas: re-work line number tracking for macros and their expansions Content-Language: en-US To: Binutils References: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> Cc: Nick Clifton , "ramana.radhakrishnan@arm.com" , Richard Earnshaw , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Marcus Shawcroft , Alan Modra , Peter Bergner , Geoff Keating In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com> X-ClientProxiedBy: FR2P281CA0087.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::6) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|PAXPR04MB8831:EE_ X-MS-Office365-Filtering-Correlation-Id: 97607427-56bc-49fc-8e68-08dad1f6bfa0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KrtDfN6mzETO6NmLm/eSwGjGH9LRXHvWPnb514IaSQR7I/XqTZBx5MrjEwLTrHPeb257H99Ci5bv62vHosmJfHbWKVU8z5gbU5e6kVESP2vFQzbmKB0tPW11HSYIIqSaOP33n6ooDJbw0b8eob5WTNiqgpj3+w7zichHXued1uLa3H0gwmrZn3RU0wiIJWss2c5iFsIVO2qnR3IDSZ0CMOOYf48foUXK2KzT1/4WBjukFcUJwbZbKiX1jHj1MwMCOdgFOQWNhLSQnAxP8W1qpIjc7Q/wW2dIhe+/y+SKMFvBWax15lxdf2b3qoolxncO/OTYhKqi9nNLndurBRHQgA3g832XISLorFKVuFKolurEmP5cycF5SRFxr4Td0u1X9vpvBylS8aQeoYh3x3yH3MbaYBkDFF9NTmvBti2S6hsktlWb0va9L/uIzZV6UK4yKWQxctj70BXgQrphAN4wUdDBHXaVfvUriUZQq57HwISbnZkrQC5U4AeR4v7bkSRsKCQ9LU9hpU+50k9HYC5sotKy/AVyzJOKYiBySjVlU5FNyHPZkIsN2aJLWHM07rBhDiTsdz2CFr60IEzo4r74e241XA5cZheC35cK4SeJttsX3lsUAUJXJYct+XIN2gwLBMUWjFgHvGJtRv85PykW5tVX46BZH/6bdYc99fBwpVd7JL/oU1sOZM+JWQ/vvzeOlIIFI3peDqgtTGidw+pyIHRCY9sjE40aE4gEqiSGzLk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(396003)(346002)(39860400002)(376002)(451199015)(2616005)(31686004)(2906002)(83380400001)(6512007)(33964004)(6506007)(38100700002)(8676002)(41300700001)(478600001)(66946007)(66476007)(66556008)(6486002)(36756003)(26005)(186003)(5660300002)(8936002)(235185007)(31696002)(4326008)(86362001)(30864003)(6916009)(54906003)(7416002)(316002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?YdAePM6MMQcOTR0h59ymD5J5Tlo6?= =?utf-8?q?u/2/a1YjY9H9xdOAdUE+T4OLKTmpd7NnGq+b+OeUV1L24w5OpEda0njyHtdOrZrJe?= =?utf-8?q?N054WRRxBhGFIYUIJkzdWhYnhdY5EAfj3n8WhBY5DFnK3g+4ZFHxFM7nOo5zDKlAd?= =?utf-8?q?s0+Ch7Yuyr1HG7ofirIzCX/htsjvxMqvX4grBGvGSfgjKKTy4E8GR1LZG81hrITYV?= =?utf-8?q?sxcBf2yfRfQCx6R8CydshJiHfW7ix5OhqK7Ws2wxPIY0O6o+ng1PLOeZOAZrCivL7?= =?utf-8?q?UMCmf7JFM0Jv6lXhTkgmyS+16vQ7RdoTZHQE6yi4hbPUFtQA9A5S1Tia6oJQ2UieX?= =?utf-8?q?44/FeqXXjs/KBICLGpTFLQ2MxG7W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VeJRtJ/q+KiBQ2AsqrGsdPW4KahngOSIFlm2h6s?= =?utf-8?q?61vmXiqq/3kH1LQsDo7BUT65SZwSSWlXVv2AixHF2m612qIOMKED0tWB9rWvYJcWy?= =?utf-8?q?5F3DU+WKtLz3pDGQRhsREK1mXYdJ0zjvIIvaeZYPVWr1CHS9V8eLDH2JQrgw3G9Fn?= =?utf-8?q?LQS/iRzXYJH1cKVqQTfZyOO2Mx90SoludofVtwle64MrXKJomoZBn1DS53C2IzClb?= =?utf-8?q?A+EdwqoQ/yvSFQz767SgSF6JC9kWOR35gzqAtbEdIxe0nYFogn1iWCO1ajF2HVami?= =?utf-8?q?eYl4m3QX6FhC?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97607427-56bc-49fc-8e68-08dad1f6bfa0 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 10:44:53.6289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UyDjAUMJz+aglNV18ciZr0ZmVgQKgaCWEydtKteUPzvGXyDEikjdmD4JJ6VX3sBNxx6LT9vo8278t8+iqy/Wsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8831 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750826971992522739?= X-GMAIL-MSGID: =?utf-8?q?1750826971992522739?= The PR gas/16908 workaround aimed at uniformly reporting line numbers to reference macro invocation sites. As mentioned in a comment this may be desirable for small macros, but often isn't for larger ones. As a first step improve diagnostics to report both locations, while aiming at leaving generated debug info unaltered. Note that macro invocation context is lost for any diagnostics issued only after all input was processed (or more generally for any use of as_*_where(), as the functions can't know whether the passed in location is related to [part of] the present stack of locations). To maintain the intended workaround behavior for PR gas/16908, a new as_where() is introduced to "look through" macro invocations, while the existing as_where() is renamed (and used in only very few places for now). Down the road as_where() will likely want to return a list of (file,line) pairs. --- Omitting testsuite adjustments from the inline patch, for its sheer size; please see the attachment for the full (compressed) patch. --- There are 86 more Arm "[Bb]ad MVE ..." testsuite failures, which I'm not (yet) taking care of here. If the concept is not objected to, I'd go and alter them all in the same mechanical way as done here for other testcase adjustments. (In cases of macros which are used exactly once in a testcase, of which there are a fair number, dropping the use of .macro may also be an option, just like already done in "Arm: avoid unhelpful use of .macro in testsuite" for another testcase.) --- Adding if (subseg_text_p (now_seg)) dwarf2_emit_insn (0); to try_macro() (alongside using as_where_top() in dwarf2_where()) would get .debug_line contents into reasonable shape (expressing both macro invocation site and macro definition location). But that's likely insufficient: We may want / need to represent macros as inline subprograms and their expansions as inlined subroutines. Which in turn looks cumbersome especially with the relatively recently added recording of functions (with which macro expansions then would better be associated, when marked as such). --- a/gas/as.h +++ b/gas/as.h @@ -436,6 +436,10 @@ typedef struct _pseudo_type pseudo_typeS #define PRINTF_WHERE_LIKE(FCN) \ void FCN (const char *file, unsigned int line, const char *format, ...) \ __attribute__ ((__format__ (__printf__, 3, 4))) +#define PRINTF_INDENT_LIKE(FCN) \ + void FCN (const char *file, unsigned int line, unsigned int indent, \ + const char *format, ...) \ + __attribute__ ((__format__ (__printf__, 4, 5))) #else /* __GNUC__ < 2 || defined(VMS) */ @@ -443,6 +447,10 @@ typedef struct _pseudo_type pseudo_typeS #define PRINTF_WHERE_LIKE(FCN) void FCN (const char *file, \ unsigned int line, \ const char *format, ...) +#define PRINTF_INDENT_LIKE(FCN) void FCN (const char *file, \ + unsigned int line, \ + unsigned int indent, \ + const char *format, ...) #endif /* __GNUC__ < 2 || defined(VMS) */ @@ -452,6 +460,7 @@ PRINTF_LIKE (as_tsktsk); PRINTF_LIKE (as_warn); PRINTF_WHERE_LIKE (as_bad_where); PRINTF_WHERE_LIKE (as_warn_where); +PRINTF_INDENT_LIKE (as_info_where); void as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; void signal_init (void); @@ -486,7 +495,9 @@ void cond_finish_check (int); void cond_exit_macro (int); int seen_at_least_1_file (void); void app_pop (char *); +void as_report_context (void); const char * as_where (unsigned int *); +const char * as_where_top (unsigned int *); const char * as_where_physical (unsigned int *); void bump_line_counters (void); void do_scrub_begin (int); --- a/gas/input-scrub.c +++ b/gas/input-scrub.c @@ -104,6 +104,9 @@ static const char *logical_input_file; static unsigned int physical_input_line; static unsigned int logical_input_line; +/* Indicator whether the origin of an update was a .linefile directive. */ +static bool is_linefile; + /* Struct used to save the state of the input handler during include files */ struct input_save { char * buffer_start; @@ -115,6 +118,7 @@ struct input_save { const char * logical_input_file; unsigned int physical_input_line; unsigned int logical_input_line; + bool is_linefile; size_t sb_index; sb from_sb; enum expansion from_sb_expansion; /* Should we do a conditional check? */ @@ -166,6 +170,7 @@ input_scrub_push (char *saved_position) saved->logical_input_file = logical_input_file; saved->physical_input_line = physical_input_line; saved->logical_input_line = logical_input_line; + saved->is_linefile = is_linefile; saved->sb_index = sb_index; saved->from_sb = from_sb; saved->from_sb_expansion = from_sb_expansion; @@ -193,6 +198,7 @@ input_scrub_pop (struct input_save *save logical_input_file = saved->logical_input_file; physical_input_line = saved->physical_input_line; logical_input_line = saved->logical_input_line; + is_linefile = saved->is_linefile; sb_index = saved->sb_index; from_sb = saved->from_sb; from_sb_expansion = saved->from_sb_expansion; @@ -267,8 +273,6 @@ input_scrub_include_sb (sb *from, char * as_fatal (_("macros nested too deeply")); ++macro_nest; - gas_assert (expansion < expanding_nested); - #ifdef md_macro_start if (expansion == expanding_macro) { @@ -283,8 +287,6 @@ input_scrub_include_sb (sb *from, char * expansion. */ newline = from->len >= 1 && from->ptr[0] != '\n'; sb_build (&from_sb, from->len + newline + 2 * sizeof (".linefile") + 30); - if (expansion == expanding_repeat && from_sb_expansion >= expanding_macro) - expansion = expanding_nested; from_sb_expansion = expansion; if (newline) { @@ -437,10 +439,7 @@ bump_line_counters (void) if (sb_index == (size_t) -1) ++physical_input_line; - /* PR gas/16908 workaround: Don't bump logical line numbers while - expanding macros, unless file (and maybe line; see as_where()) are - used inside the macro. */ - if (logical_input_line != -1u && from_sb_expansion < expanding_macro) + if (logical_input_line != -1u) ++logical_input_line; } @@ -471,10 +470,6 @@ new_logical_line_flags (const char *fnam case 1 << 3: if (line_number < 0 || fname != NULL) abort (); - /* PR gas/16908 workaround: Ignore updates when nested inside a macro - expansion. */ - if (from_sb_expansion == expanding_nested) - return; if (next_saved_file == NULL) fname = physical_input_file; else if (next_saved_file->logical_input_file) @@ -486,6 +481,8 @@ new_logical_line_flags (const char *fnam abort (); } + is_linefile = flags != 1 && (flags != 0 || fname); + if (line_number >= 0) logical_input_line = line_number; else if (line_number == -1 && fname && !*fname && (flags & (1 << 2))) @@ -499,15 +496,6 @@ new_logical_line_flags (const char *fnam && (logical_input_file == NULL || filename_cmp (logical_input_file, fname))) logical_input_file = fname; - - /* When encountering file or line changes inside a macro, arrange for - bump_line_counters() to henceforth increment the logical line number - again, just like it does when expanding repeats. See as_where() for - why changing file or line alone doesn't alter expansion mode. */ - if (from_sb_expansion == expanding_macro - && logical_input_file != NULL - && logical_input_line != -1u) - from_sb_expansion = expanding_repeat; } void @@ -516,6 +504,33 @@ new_logical_line (const char *fname, int new_logical_line_flags (fname, line_number, 0); } +void +as_report_context (void) +{ + const struct input_save *saved = next_saved_file; + enum expansion expansion = from_sb_expansion; + int indent = 1; + + if (!macro_nest) + return; + + do + { + if (expansion != expanding_macro) + /* Nothing. */; + else if (saved->logical_input_file != NULL + && saved->logical_input_line != -1u) + as_info_where (saved->logical_input_file, saved->logical_input_line, + indent, _("macro invoked from here")); + else + as_info_where (saved->physical_input_file, saved->physical_input_line, + indent, _("macro invoked from here")); + + expansion = saved->from_sb_expansion; + ++indent; + } + while ((saved = saved->next_saved_file) != NULL); +} /* Return the current physical input file name and line number, if known */ @@ -534,11 +549,53 @@ as_where_physical (unsigned int *linep) return NULL; } -/* Return the current file name and line number. */ +/* Return the file name and line number at the top most macro + invocation, unless .file / .line were used inside a macro. */ const char * as_where (unsigned int *linep) { + const char *file = as_where_top (linep); + + if (macro_nest && is_linefile) + { + const struct input_save *saved = next_saved_file; + enum expansion expansion = from_sb_expansion; + + do + { + if (!saved->is_linefile) + break; + + if (expansion != expanding_macro) + /* Nothing. */; + else if (saved->logical_input_file != NULL + && (linep == NULL || saved->logical_input_line != -1u)) + { + if (linep != NULL) + *linep = saved->logical_input_line; + file = saved->logical_input_file; + } + else if (saved->physical_input_file != NULL) + { + if (linep != NULL) + *linep = saved->physical_input_line; + file = saved->physical_input_file; + } + + expansion = saved->from_sb_expansion; + } + while ((saved = saved->next_saved_file) != NULL); + } + + return file; +} + +/* Return the current file name and line number. */ + +const char * +as_where_top (unsigned int *linep) +{ if (logical_input_file != NULL && (linep == NULL || logical_input_line != -1u)) { @@ -549,4 +606,3 @@ as_where (unsigned int *linep) return as_where_physical (linep); } - --- a/gas/macro.c +++ b/gas/macro.c @@ -131,23 +131,21 @@ buffer_and_nest (const char *from, const else from_len = strlen (from); - /* Except for macros record the present source position, such that - diagnostics and debug info will be properly associated with the - respective original lines, rather than with the line of the ending - directive (TO). */ - if (from == NULL || strcasecmp (from, "MACRO") != 0) - { - unsigned int line; - char *linefile; - - as_where (&line); - if (!flag_m68k_mri) - linefile = xasprintf ("\t.linefile %u .", line + 1); - else - linefile = xasprintf ("\tlinefile %u .", line + 1); - sb_add_string (ptr, linefile); - xfree (linefile); - } + /* Record the present source position, such that diagnostics and debug info + can be properly associated with the respective original lines, rather + than with the line of the ending directive (TO). */ + { + unsigned int line; + char *linefile; + + as_where_top (&line); + if (!flag_m68k_mri) + linefile = xasprintf ("\t.linefile %u .", line + 1); + else + linefile = xasprintf ("\tlinefile %u .", line + 1); + sb_add_string (ptr, linefile); + xfree (linefile); + } while (more) { @@ -249,14 +247,8 @@ buffer_and_nest (const char *from, const } /* PR gas/16908 - Apply and discard .linefile directives that appear within - the macro. For long macros, one might want to report the - line number information associated with the lines within - the macro definition, but we would need more infrastructure - to make that happen correctly (e.g. resetting the line - number when expanding the macro), and since for short - macros we clearly prefer reporting the point of expansion - anyway, there's not an obviously better fix here. */ + Apply .linefile directives that appear within the macro, alongside + keeping them for later expansion of the macro. */ if (from != NULL && strcasecmp (from, "MACRO") == 0 && len >= 8 && strncasecmp (ptr->ptr + i, "linefile", 8) == 0) { @@ -267,7 +259,6 @@ buffer_and_nest (const char *from, const s_linefile (0); restore_ilp (); ptr->ptr[ptr->len] = saved_eol_char; - ptr->len = line_start; } } --- a/gas/messages.c +++ b/gas/messages.c @@ -18,6 +18,7 @@ 02110-1301, USA. */ #include "as.h" +#include #include /* If the system doesn't provide strsignal, we get it defined in @@ -119,7 +120,7 @@ as_show_where (void) const char *file; unsigned int line; - file = as_where (&line); + file = as_where_top (&line); identify (file); if (file) { @@ -130,6 +131,25 @@ as_show_where (void) } } +/* Send to stderr a string as information, with location data passed in. + Note that for now this is not intended for general use. */ + +void +as_info_where (const char *file, unsigned int line, unsigned int indent, + const char *format, ...) +{ + va_list args; + char buffer[2000]; + + gas_assert (file != NULL && line > 0 && indent <= INT_MAX); + + va_start (args, format); + vsnprintf (buffer, sizeof (buffer), format, args); + va_end (args); + fprintf (stderr, "%s:%u: %*s%s%s\n", + file, line, (int)indent, "", _("Info: "), buffer); +} + /* Send to stderr a string as a warning, and locate warning in input file(s). Please only use this for when we have some recovery action. @@ -146,6 +166,7 @@ as_tsktsk (const char *format, ...) vfprintf (stderr, format, args); va_end (args); (void) putc ('\n', stderr); + as_report_context (); } /* The common portion of as_warn and as_warn_where. */ @@ -153,10 +174,15 @@ as_tsktsk (const char *format, ...) static void as_warn_internal (const char *file, unsigned int line, char *buffer) { + bool context = false; + ++warning_count; if (file == NULL) - file = as_where (&line); + { + file = as_where_top (&line); + context = true; + } identify (file); if (file) @@ -168,6 +194,10 @@ as_warn_internal (const char *file, unsi } else fprintf (stderr, "%s%s\n", _("Warning: "), buffer); + + if (context) + as_report_context (); + #ifndef NO_LISTING listing_warning (buffer); #endif @@ -194,7 +224,7 @@ as_warn (const char *format, ...) } } -/* Like as_bad but the file name and line number are passed in. +/* Like as_warn but the file name and line number are passed in. Unfortunately, we have to repeat the function in order to handle the varargs correctly and portably. */ @@ -218,10 +248,15 @@ as_warn_where (const char *file, unsigne static void as_bad_internal (const char *file, unsigned int line, char *buffer) { + bool context = false; + ++error_count; if (file == NULL) - file = as_where (&line); + { + file = as_where_top (&line); + context = true; + } identify (file); if (file) @@ -233,6 +268,10 @@ as_bad_internal (const char *file, unsig } else fprintf (stderr, "%s%s\n", _("Error: "), buffer); + + if (context) + as_report_context (); + #ifndef NO_LISTING listing_error (buffer); #endif @@ -290,6 +329,7 @@ as_fatal (const char *format, ...) vfprintf (stderr, format, args); (void) putc ('\n', stderr); va_end (args); + as_report_context (); /* Delete the output file, if it exists. This will prevent make from thinking that a file was created and hence does not need rebuilding. */ if (out_file_name != NULL) @@ -312,6 +352,7 @@ as_abort (const char *file, int line, co fprintf (stderr, _("Internal error in %s at %s:%d.\n"), fn, file, line); else fprintf (stderr, _("Internal error at %s:%d.\n"), file, line); + as_report_context (); fprintf (stderr, _("Please report this bug.\n")); --- a/gas/sb.h +++ b/gas/sb.h @@ -66,11 +66,9 @@ extern size_t sb_skip_comma (size_t, sb /* Actually in input-scrub.c. */ enum expansion { - /* Note: Order matters! */ expanding_none, expanding_repeat, expanding_macro, - expanding_nested, /* Only for internal use of input-scrub.c. */ }; extern void input_scrub_include_sb (sb *, char *, enum expansion);