From patchwork Mon Nov 6 14:22:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 162031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2691640vqu; Mon, 6 Nov 2023 06:23:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzrHkVNsLpumhZIZ2XBAT39eZUWbYIfxhmi4aamgwtiq217Okqj7JAvOSzFXgMEZtHTsWP X-Received: by 2002:a67:e047:0:b0:45d:a10f:cb5c with SMTP id n7-20020a67e047000000b0045da10fcb5cmr6725002vsl.18.1699280606792; Mon, 06 Nov 2023 06:23:26 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1699280606; cv=pass; d=google.com; s=arc-20160816; b=UH3yKR9R/jNT4zkOVF6SAWTSNOWyJbTEsnlkNp8qt+1kVAv2a3+JNH6DH8OqdbU/PT dyQC9YvBLTMS60DWtEw5bs75xzn0Hv1hD0wUK1EVf+BLIlJeuF4QTIshIPm9t4EKLGEb SvbU+pClf6ikpfTXTWFBd/nbFwQuyxrvBOQ+8Z0MnrpngLs7xJHUGpXkro01TH0cyGkH m24l1iuJjyGyDIepjMx5FMaZ1Jaghhf/ZSggQ3XpxctV9oVfSOw9OAg8BoCinrAjDiRr tjG/ytukRIDjlgE7tDZ9lEMqizFIfREgQ2igH1GlHdog4vCrXOrb59c7aHDiC9ujvd3m Nk2w== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:date:message-id:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=eeVhyyeFP19ot2WtNqKaFVlkhQ5hohbYb4oP56DM9bs=; fh=2DbSPqOhyO7CNtGa024QKgSiHKlKGVt2h+1rlgWLnZI=; b=HeOFhf7ko7chylYCfOYe8W8nbodS3W0XOHj5Fj9A6aaZEkMsKCdKDXNUxr2JVVylpm lPCkzol24joA50w6EBJewm5g5HY7xPK7QUDoHQNaP0N3giGZgF8iMIRBopCOf4MyAFPo avGlreysynnGu/YGWFvjczbyIRZ3UXOpHkuFo4CjZMnMaoI2Q5EzdTdRPQPKtzNApQSo T/+hNKTAoGCUNXgixt4BMPtUTDrl66cix62LaIBYI+tM3sjax/wAI8SWklwiAwBbAGeO vXsqwRPGQfkByDiGlPiDmbTBgzZIdUKG+sDVID+MgTi8b+ldwxqyqx0XpopIcQvQx22H O6dA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=XL9H6a+E; arc=pass (i=2); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fj25-20020a05622a551900b0041fe91a38a7si2174651qtb.527.2023.11.06.06.23.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:23:26 -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=@suse.com header.s=selector1 header.b=XL9H6a+E; arc=pass (i=2); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B78738618B9 for ; Mon, 6 Nov 2023 14:23:16 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2083.outbound.protection.outlook.com [40.107.8.83]) by sourceware.org (Postfix) with ESMTPS id 5977B386186B for ; Mon, 6 Nov 2023 14:22:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5977B386186B 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 5977B386186B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.83 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699280572; cv=pass; b=hGrto2FAxFczgccNPc+6gvBTPBfJiyPXUv+cHaxWkaezkt3XV6Ags3jSw9WGXKpntgcIlcSO2yoVr7U4m+YBY6wL+cnOBYa/cjbQP55yXqonE3J30bHae7zSrdaYW6WWoeC1JGdLkOMINjh5SosWP02b7OLVNUi75lChjO3r42A= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699280572; c=relaxed/simple; bh=mo/zFE47HiXlW38zAoyeACN/LJxU802TO4pUQ2v/7jA=; h=DKIM-Signature:Message-ID:Date:Subject:From:To:MIME-Version; b=Uyieux8BcJCcIK4OSP0PH1iz9Xh9LmgGFGOO07c+pmOCqxrlIhp13/dvQIKmllWZWMIYfWZCxlZpB9aWj/X/iQ1ZQIOQYJ/Yn/Je9G+qnRmgrxEMxKokd+NCgnrcWkTrKH39dHobtCTosoOQNO69zeXbK/00Wr6Rr/FlXKuPcSM= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GiCsUIjNqArLMH0L+eiMPBfzmtYBhVp+4nGavvFDKZGak3RjgF/gaKUOx9Pnxa8wiIuWOF3nZfhsCh8Lg6FHE4gGohI0vQqxofjy26ESsu1GyYWwwzRu0nAWyP5uVZaENXPdycxRnWeMmQy4I3Nzz5F+TkpjHiVHl7gnqDAhCU6YeI7uLEI6TBqaGjd8yMXcl8jrB1WWmIukNdhFq4YUSH4Uff+MMQRSe/Xq211DrHy4jdb03CUv6wnqwh20qIcDy3JsWLpJ5tZL15nuN8IJWoyqtpe6BoTXCR2XUgNNY5WV5wdcrV8F13j8y4Qm0MobRYpvoBMEZ8i1SlYw40nEfQ== 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=eeVhyyeFP19ot2WtNqKaFVlkhQ5hohbYb4oP56DM9bs=; b=J0OK3h8t4Qx+unyVx4RYfOYY6t0bFZ6eF5RpGnrexc7/4tdUosO5d6/ulrHg+gd+UCRl+g5yR3GHTfrGn1jSdAQPa+C+0nYeUOPYlVIK1WiVYWFDzhuz4MIwZF6BVOTlgNvCsxmnLX0425WURjH5gtrixvDXXZx2hyb/4b+uTvdQEejl0e9X+dnv2qayfuhuv1qBOK8Zop98e/Zjplvob7dQhwFoASG8GueKTkRbFGSiGj6a7BpjdhKZLLyVlY+rBgMqZsRBzA3263Y1wUuHWh1fAvYwfSjjJaF2LlSD84snjrPoH9s7bseaKsIsqHHIztNEEYQBv2fRt8601D+wjA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eeVhyyeFP19ot2WtNqKaFVlkhQ5hohbYb4oP56DM9bs=; b=XL9H6a+EqFrGFYvr9KCdzOyZTnVbOuOggE82SVOVd4v+5i+961MLOsHA56Di5Q3IAI1M3lVTwwkUDi+Z4I5Q0isOASAgNenb/043w16UMQEG9nT0j5QM8blGINN0pKD9Nll1f/z+LVEM2ntpCI+hAbLmEG+KcskKCa5TJqBGO5C+cF4MqYuAMD6rIZfsyWnSSMap16xuLP06KO1C/UB9ag/t2FWParH0M6EfbR7OqyWTkYqGxLQUXd84bBVTiUUK/CJEo2d3yk1JveXB+1keN5KTPgIB1r92D5W3XZMwdJpg4NlYhxd8qWPQcCSN9idXUUciCq/XNd2ttXAAhPk33A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AM0PR04MB6802.eurprd04.prod.outlook.com (2603:10a6:208:184::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.13; Mon, 6 Nov 2023 14:22:49 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::eb8e:fa24:44c1:5d44]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::eb8e:fa24:44c1:5d44%3]) with mapi id 15.20.6977.016; Mon, 6 Nov 2023 14:22:49 +0000 Message-ID: Date: Mon, 6 Nov 2023 15:22:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: [PATCH 2/2] x86: don't allow pseudo-prefixes to be overridden by legacy suffixes Content-Language: en-US From: Jan Beulich To: Binutils Cc: "H.J. Lu" , Lili Cui References: In-Reply-To: X-ClientProxiedBy: FR0P281CA0172.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b4::14) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6802:EE_ X-MS-Office365-Filtering-Correlation-Id: 82c5fdc7-63e3-4214-4a3a-08dbded3dac5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: esGkgeJR4ggYPuOwOGAeZPSAdDGuILvvs4mO96JuwTYNEwylxoluJhxlxVGJsXHaLmwSoHVRwGY2PdMmdWufrUQHyWTenJ/eqm7xzkM3qdgYBO26tDTqFhS+cDL+YBQeWZEUa/+hHu15M7K7djzewiSgpU/aSIb38X/OH1LFaNHu3TVX78QU8n52uQNVwvTZ7LEf+1hWIyrpCKs46YTI8cFmIMvK799Xrw4L4zxoLctK6H8Ref9VuvkCvnrrUThCnvcew3ZSvaz42P2Zot2YrXvJt0ykUGVTjBZp6FQYRdb3LvsHhD8naB+fG3+PkeM/8to7jvUpsNgwM4pUFu9hemLstwH+UXm3e0BVttnQtFGtJ3sa+j1PsG9jz1rfI0OiBHz2E3s0mg3OMgI+XsNJXRBwYYFvzf7q7gVII8+uSJiCyzJFNvPBJcuu0GjQIdS5xPGQDhNDv2BRRolUNSA55KnB0+J8igZWvKiCJn/zKYLMygQg+0glSb4EtQkXIvxid6sjvm+pKQ675wSLkAY+4P3IErRNP6zM0BqdMqrwBGThhQl1Mqc6hBjUjPfz+iLYXCqdwblulgKHq7fOgPMHA/HNCK7UxVf2aQlK4uKUz1QDLIkTGzNKhXIYgF6Qyg0+Nvzh2s/7nftM9QTOkzVCpg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8790.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(396003)(366004)(136003)(376002)(346002)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(31686004)(66556008)(66476007)(66946007)(316002)(54906003)(6916009)(31696002)(86362001)(36756003)(38100700002)(6512007)(2616005)(26005)(6506007)(8936002)(478600001)(5660300002)(4326008)(41300700001)(2906002)(6486002)(8676002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Jtr8UwEmi+HpUSKs0dvjar3mSLIB?= =?utf-8?q?rJrL/w2pjsxcN4h0JqDJV/r9Yi+8lSkxSbJSWHKALRCTFdjjYt1mIvJ53XXLeYQHy?= =?utf-8?q?uqOO8v21EFFh7TIdD7VKiT5zSKrFx/M2FJCWlVJpWHsMwhrn8iwcoO3xUyCC5r7W8?= =?utf-8?q?W/wv89SeXPoHKR8KckyEKPCTemMmzzuT3WOm7J3rajaOLH5v0jOHZfOsAChwFFpKf?= =?utf-8?q?vH90tfdGQs9/nXw0opp8Oyua95hAzkXuj99ZCWufyiD6oW3P60XZgv69lRyhq2uKn?= =?utf-8?q?f+vl8Cd2bcmMThI8LyyxWmWgT3IryVKmg4/+5Vez8T/zcsd0EiEKiNKVQyaWxLA/N?= =?utf-8?q?Mf8Gd4ZcnrhfmOZ/qNO6G+EZo0dwJC61OLkBXm+SbXLJ+Mh2wLGSgIrjHn5Fb9eZN?= =?utf-8?q?wi9xc/S+vym9hW8GIVIxtcZapHiFN9OYAeudmdMlEbUrFf2rOiF3CHglicQRqlfvs?= =?utf-8?q?Oc2x7lzYp6LZXCqa8+Nu+9TCSPlK78j9nQCFzpwEoIjgQilglLaRrUHhpZTElYl7a?= =?utf-8?q?yNMrOp0aQr1RcODO1AiXlY4XDewgi24N16bB3YwmrH2LWENnMEWtkpuGmEoOdQ2Ap?= =?utf-8?q?KCJFCVEJSb5vzAdBM9AG/+TGMtgQtmeXWo/tTLH9nTSgoAW3SZqpmlFOAslE7Z+fB?= =?utf-8?q?XfW+N6lhl1WfkqTITXXmIU+OPX2h+Xbz0jHVysc9kNJEA4ke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enant-Network-Message-Id: 82c5fdc7-63e3-4214-4a3a-08dbded3dac5 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 14:22:49.4645 (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: y84i0WKZ8xZDthG8hXDUhRtucysGjugrNm4Hz5phsL7XX5NwyMyp9KcbHn7J1ioZuDwvSMXob2B6z+da2DdBOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6802 X-Spam-Status: No, score=-3026.6 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, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781824861610313083 X-GMAIL-MSGID: 1781824861610313083 Deprecated functionality would better not win over its modern counterparts. --- We could be more strict, in disallowing legacy prefixes when any pseudo- prefix was used. I further wonder about us accepting .d32 even when a pre-386 CPU was selected. --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -5899,16 +5899,32 @@ parse_insn (const char *line, char *mnem Check if we should swap operand or force 32bit displacement in encoding. */ if (mnem_p - 2 == dot_p && dot_p[1] == 's') - i.dir_encoding = dir_encoding_swap; + { + if (i.dir_encoding == dir_encoding_default) + i.dir_encoding = dir_encoding_swap; + else + as_warn (_("ignoring `.s' suffix due to earlier `{%s}'"), + i.dir_encoding == dir_encoding_load ? "load" : "store"); + } else if (mnem_p - 3 == dot_p && dot_p[1] == 'd' && dot_p[2] == '8') - i.disp_encoding = disp_encoding_8bit; + { + if (i.disp_encoding == disp_encoding_default) + i.disp_encoding = disp_encoding_8bit; + else if (i.disp_encoding != disp_encoding_8bit) + as_warn (_("ignoring `.d8' suffix due to earlier `{disp}'")); + } else if (mnem_p - 4 == dot_p && dot_p[1] == 'd' && dot_p[2] == '3' && dot_p[3] == '2') - i.disp_encoding = disp_encoding_32bit; + { + if (i.disp_encoding == disp_encoding_default) + i.disp_encoding = disp_encoding_32bit; + else if (i.disp_encoding != disp_encoding_32bit) + as_warn (_("ignoring `.d32' suffix due to earlier `{disp}'")); + } else goto check_suffix; mnem_p = dot_p;