Message ID | 168dfa6e-63d2-06d5-49d5-4d7a1797efb4@suse.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp382797vqo; Fri, 5 May 2023 06:01:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iIxskS1e0AHPZbf3kb+zlDQUg4RTWBm1AkhDXMeEkH2MTVaMmPrvjY2NtsVPlHDn21GTd X-Received: by 2002:a17:906:dc8e:b0:965:f69b:4949 with SMTP id cs14-20020a170906dc8e00b00965f69b4949mr583425ejc.36.1683291694569; Fri, 05 May 2023 06:01:34 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id tb23-20020a1709078b9700b00965e3a8dcfbsi962785ejc.900.2023.05.05.06.01.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 06:01:34 -0700 (PDT) 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=sXFAlK2c; 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 BA64F3856091 for <ouuuleilei@gmail.com>; Fri, 5 May 2023 13:01:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA64F3856091 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683291681; bh=M7pejM6DUdW/l7KMUABqeo+N2EP/cugWa7HuI0NO+BE=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=sXFAlK2ckJP+gKH17PBzWB422fLFqvahSTJKAXbRH5ucBMPlIeMlH8kvmpqI+jX5P t65sR3Uf/McXFSUmMs1hxg8vjlwdzOXIb1PnmQJohDTUaCBLFa8FLVVx/qY4v5xaaw +hFWIcOSpPAP2FwoVi0vg8M9YuwTKcnuv4HQbK7c= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by sourceware.org (Postfix) with ESMTPS id 4942E385697F for <binutils@sourceware.org>; Fri, 5 May 2023 13:01:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4942E385697F ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ky0K8JAnkZGOsjBtO4EgPaKRH3o9x4LguhdWlWaB/pnX79cHUK6MTiVdnzFuoO3Yy5DmuyLdEu+Kwz9XzoLu58pNv/hauwE5uBNuAWPXsRdzHVzbD6c/D45i8YUfk+Hg1LdSdT3ncM6ih5hbv5jp/g9Azzh75daoe6apOwboNSamsWbAFeTg57COGpe/CpbyztNb2Yu4+94FpStnUwuKdgSEVj29jRVFotUtQyhor2p86F+f1zsBp1aGU+quChJUN3PBom78ChBeNm5OcwrD9Zmm4dw67AA3iFVNBs0b9G1cd2cxrfwQacqzc1pZ8q8QMsUBZUvua84CZHWa+VcdoA== 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=M7pejM6DUdW/l7KMUABqeo+N2EP/cugWa7HuI0NO+BE=; b=XtchC600+KzKjK8Z195nWmMlb99etjtglqrZclckVMbg9prAhr2tB/z/fHEsNqV14eqkwBFRCwUIDy1pGh0dFVsvsrxz0gQyULD4JZNWNQaubgqPNSiDOTVMPvyeAeYCRzY9i+wM40t/INZjPwA7+4LW7KC/Gp5Ti7MM6P95B+VB+aNvj84+rR/ZVXpBnpOzq5DJJEqduqyk6CncCCYZ/N+MWfQpm3p2J5eng6QwoSLA0zv0MUZ3CMPskfZk6P14UXM1sobPp92hhVOfm/autTRkgPZNxOREBnrGkA/RBMRLSVg2mw+Hyb0seMqzJvoEFedjEhW9bYlhaBS+oXnKxg== 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 AM6PR04MB6551.eurprd04.prod.outlook.com (2603:10a6:20b:fa::20) by DUZPR04MB9848.eurprd04.prod.outlook.com (2603:10a6:10:4dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 13:01:12 +0000 Received: from AM6PR04MB6551.eurprd04.prod.outlook.com ([fe80::768c:6df7:9afb:acd7]) by AM6PR04MB6551.eurprd04.prod.outlook.com ([fe80::768c:6df7:9afb:acd7%7]) with mapi id 15.20.6363.027; Fri, 5 May 2023 13:01:12 +0000 Message-ID: <168dfa6e-63d2-06d5-49d5-4d7a1797efb4@suse.com> Date: Fri, 5 May 2023 15:01:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: [PATCH 1/4] x86: tighten extend-to-32bit-address conditions Content-Language: en-US To: Binutils <binutils@sourceware.org> Cc: "H.J. Lu" <hjl.tools@gmail.com> References: <a55dc85d-47b4-8494-461a-f8b955cb033f@suse.com> In-Reply-To: <a55dc85d-47b4-8494-461a-f8b955cb033f@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0144.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:98::18) To AM6PR04MB6551.eurprd04.prod.outlook.com (2603:10a6:20b:fa::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6551:EE_|DUZPR04MB9848:EE_ X-MS-Office365-Filtering-Correlation-Id: 784231ff-2638-4b4d-7800-08db4d68cd38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4sINCJwhm00BSdJcEyuwr16bhaTaNFtgZ7O80LaCRi0yM9a1o/jnUjJ5lZp8jthYT/yxHjF7WtcTlYLXOCCcvE28k66VyCF1iuMq6ZvBqFrGASxoeI3LIoSZv2bCVYmEXDIjflOPjEAA8mFH3gZF7O+OmU7ZHM6trhf4l9vzsK30WozYJVKrYjHAWFJJybezR78MjV3DJgfzqvXthH79mzAFhowH4AAzq0QrfKOk4dTFvRMo7mJ+v76npRGUsqRxVxTXqAim2awNcRcAvkSCqZwRdgCt30gkMhOxAvtonIr9jNEZzX7eULS9phtXfoQNmEvXFClF7454bsrEmYkXQAAkJuto3pHF/r6yUbm6El3NX8gOZlDyQtwckt+NAWfrp21A7ljxyWJGHgPQFs+hHn2NjNNuWXz8GIKpJ1sbG96V3TEKsBd7t2Epc3a/oSBiBDXaGeIpd1HjqQ/b8AkI0zQE494Mm73T3sTShtItRp7XTwroQV/joc2OlUeHI35HFu/bsOaTlvyJgofLFXunJXAWKZFdeud8Ec8XqyjfCeJQW4C1yt6ENY4STBSsUuGCHaUeiIvbStq/sETHuhtCWtPVXhhF9+cH6TG+HnDZOQ+PaJd9QOCArytpeaet1Kq8WXiNr/hJa7HWvCSNZFjBZg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB6551.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(136003)(346002)(396003)(39860400002)(376002)(451199021)(36756003)(31696002)(86362001)(316002)(6916009)(4326008)(66946007)(66556008)(66476007)(6486002)(478600001)(41300700001)(5660300002)(8676002)(8936002)(2906002)(4744005)(38100700002)(186003)(2616005)(6506007)(6512007)(26005)(83380400001)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?32Ni87e6hC10XA1w492IXf9Q2SyK?= =?utf-8?q?WyQMA4h3/cnPliPw6TPKCZ4g3dlmPcC8AnlzDY2i8cQAvaQUZgNdiN/vcyl/2pJiH?= =?utf-8?q?4hYWlFDtao4HUYz3OE4C5+133ETTmTRBLZWy3bOirhktPLDxzV8Nm7OImcIUOFqc6?= =?utf-8?q?V0GDW4W6D4+Zu+aCqPZhE5Rr75TPAjhObi9IJUdYmZFot2JNVa+oVzKyPOBUWW1sx?= =?utf-8?q?tR49Oa00sxZ1sxlRpdewkLa+2D4dSbEZhA6gsGCV2AEZoj8YHqSib+ZtVjF3N1QHO?= =?utf-8?q?F163Yrxd8fgzNil2UYDwFXq02Y7Mb8Cc5fF5yXMWIAF9V1RLZViJlqN9ZDor1GX9y?= =?utf-8?q?6+YvrYjTRkdancBadF3p3rJYOCYowSI4GMRYRAyOqlF8rnDzCPrjt9rluFi8AksAQ?= =?utf-8?q?IgzRBzNSyzo6IPjhayUuiwtlS1e+y2972nkdH0J4IVrQS8GEZsHSYp9OXsrkiIP0r?= =?utf-8?q?cRCAuTWJLoYIPyCczFcvCgAWUj0APde4h8+Gqpd4w5hnLN6l5l+s50lVSLDpVVnJg?= =?utf-8?q?NSSlJOtKn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g+crJhuFtfge5ISmdXgFt+4Ye8wrNwNyrs22IbmGo0a?= =?utf-8?q?3pcDrY4iEyPFFs8a1GrrfCBBZxIC3jDPOpJwvV01mrYI2S5yd/SeHR/QfXDDKkjVY?= =?utf-8?q?fZLYp51ElpwW?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 784231ff-2638-4b4d-7800-08db4d68cd38 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6551.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 13:01:11.9846 (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: 14iu3UruD0YeOlsamBhP2uduuqDDmx47bi3rMariTUkyxJXv/Bd9Y6QgC/SL7+sc68iMho3QVVDlnHyAoe68iQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9848 X-Spam-Status: No, score=-3028.0 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.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Jan Beulich via Binutils <binutils@sourceware.org> Reply-To: Jan Beulich <jbeulich@suse.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765059271711876235?= X-GMAIL-MSGID: =?utf-8?q?1765059271711876235?= |
Series | improve range checking for certain constants on x86 | |
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Jan Beulich
May 5, 2023, 1:01 p.m. UTC
In a442cac5084e ("ix86: wrap constants") I made the truncation condition too relaxed: Any indication of a mode that's possible with BFD64 only should avoid the truncation. Therefore, like in the other two cases of calls to extend_to_32bit_address(), also check whether we're generating a 64-bit object.
--- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -11684,7 +11684,7 @@ i386_finalize_immediate (segT exp_seg AT /* If not 64bit, sign/zero extend val, to account for wraparound when !BFD64. */ - if (flag_code != CODE_64BIT) + if (flag_code != CODE_64BIT && !object_64bit) exp->X_add_number = extend_to_32bit_address (exp->X_add_number); } #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) @@ -11976,7 +11976,7 @@ i386_finalize_displacement (segT exp_seg If not 64bit, sign/zero extend val, to account for wraparound when !BFD64. */ - if (flag_code != CODE_64BIT) + if (flag_code != CODE_64BIT && !object_64bit) exp->X_add_number = extend_to_32bit_address (exp->X_add_number); }