From patchwork Mon Apr 24 07:34:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 86885 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2563886vqo; Mon, 24 Apr 2023 00:34:38 -0700 (PDT) X-Google-Smtp-Source: AKy350acdd8i+ViTzkDPwgedBP9trLxcr3jFe9YVuCPqic+iGwj8hsEKoPyd+wp202027oTBWLtm X-Received: by 2002:a17:906:fd57:b0:8b1:7ae8:ba6f with SMTP id wi23-20020a170906fd5700b008b17ae8ba6fmr8234329ejb.16.1682321678686; Mon, 24 Apr 2023 00:34:38 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h25-20020a17090619d900b0094f765f6b53si7364092ejd.600.2023.04.24.00.34.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 00:34:38 -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=gfuh65v+; 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 598383858C2F for ; Mon, 24 Apr 2023 07:34:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 598383858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682321677; bh=K5MDzv5lJvfNReY7p920qgw0DZuhUTDOQfIeCjNxctI=; 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=gfuh65v+nssXzQwlD7AbVBgi6ZsOq162cpLJGVv3MkuzVnCdBtDsolvDZVTkd/s35 hWTLopL7MfrxxsbnXdQOQHCO7jSY68pt9fpU0d30W0iBAoZiXBd/RDktAXQuNNsszU ie6c9ewAQ/sR2AKkKOxG1fV0zW4FUX0zXC0Blyos= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2075.outbound.protection.outlook.com [40.107.14.75]) by sourceware.org (Postfix) with ESMTPS id 6FEEC3858426 for ; Mon, 24 Apr 2023 07:34:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FEEC3858426 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIU4zupDZ8rfFu+USY2PeB8+2mw7qIlrpydEzzocrTPqh7jJ3RMzaXe9YM1NRrVC9xsldXWS8m+zXuywPN/TYMvzNPXDvDArH26aR4r+Eg8LKh3seHLpIM4OO1yZnFjxV3KXVyifow03xggYremu9xT6MJXQg64qP+HFQi4zDWBoco4Fq/oOBjYuBs1gLYY+htQ7xsJSXmvjXzUgcJjuuFSehohcowBvJ00i1ngJKhyjlTsB1j9UIZix+YqRs75CPOXlPW5iHbI9JQmvOnCkpRTyp7ip4rvMR0hsMKmL34DM5JTrgMmkOFhbRu3/wZmAonlTJIMc630QralZuLEVsQ== 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=K5MDzv5lJvfNReY7p920qgw0DZuhUTDOQfIeCjNxctI=; b=Z1Bky80LEdOfELhX8eDupe68lgJuBDNt8u5ZIGZnkDMIPWQv410Vrm+6KziY6XegAh02iPqwjkvVE9I/Dj0FIfIA7YvGj3TLJRXwnKXgvKmlc0EJo0NbLXRSw44Rf5lTVfdHT5eCn8LxYQHh0XftPeL1tSMmu+P9quMk4iQD1/cRbns3h/+XRsWmcvENhneagkKj61w58QcYjk+zUtY+X9DDcv9sy0hcMGgwNEabV3Q39WM4ltRYejEvfJbi8TrBYmcDPMatbfLsQZ05TtGwt42na9I/7szjbIW4PQnkQXX4S8p3f/hzCaRLcT/PnFEy5SS4iIl8xEnWIRuHL0jJhw== 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 AS8PR04MB8311.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Mon, 24 Apr 2023 07:34:26 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae%2]) with mapi id 15.20.6319.033; Mon, 24 Apr 2023 07:34:26 +0000 Message-ID: Date: Mon, 24 Apr 2023 09:34:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH 1/3] x86: work around compiler diagnosing dangling pointer Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> In-Reply-To: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> X-ClientProxiedBy: FR3P281CA0195.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::7) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB8311:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ecd1a3c-2dd3-4100-a5cc-08db449654a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ygzA4jgF2sYVvBhLt7Qf6PW829X8AcJtbcwKTOdtjgV7Dev9AlZRLNSySbFZph/WDUe2oJF/JLgF8D6AwhULxNnJyyVXr9wzw2d18f518B303PAsPNDIyvpMv9592N9b9HHdnQrNDAz5tLWXU1az7moSMi6r+8fzB3FOBmV0u4mxVZ60BgStREOAOjZNO/24O2vkz6LmWL1F7+B0lnA5/T+9xF2GTH8vQFkTDL+c5IAcn00zodM4ahdhv9TYmaYd7ubiK+pkLlYjs4hSctcAGZuqhJfZ6V+fUPmKV5uvThYLOxQ0Y9AYQ45ilNZXbGaP0beqO5y6G1ku1joktDI4+IjH9eEX+4Qj7mni1IEhtoTM8C+O742fZERpzEgyKNuDr5TRciOChMS60FHUH+jEjzW+srwIe1r9vslK99XSzLYr/zjgGkg3d/1eaOn/ofxoA2w1M4cdgT2hHlFwPHCrd+iKsCYQNSZ5w2F+DA4TWvL+Zf+9VqNQ8S2ORuQ+x1ZY4n9dkOs7fw6Wkh5V+tS4eQ2axC2MFe7EAVwNJfQtvA5HelYS1xUpCTgdmuGNPB8QEQ5iaLyqF7oTQgpcLC4V5hJKmBLQjD2feu81rhSotWhPAB9XZP/mlEMEjv/GimPeiRr6u5r86r//Zjb9EoCb9A== 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:(13230028)(396003)(376002)(346002)(136003)(39860400002)(366004)(451199021)(2906002)(6486002)(2616005)(6512007)(6506007)(26005)(186003)(66946007)(66556008)(66476007)(8676002)(8936002)(316002)(41300700001)(6916009)(4326008)(478600001)(5660300002)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Qo5SiujFod6L0BgkPwfdQ3UDy0en?= =?utf-8?q?Nuc6PonxK16u8VtRVje0sNfazLufzwyF3OHo1FkQfH1O876VxagFFlhcVfwe1SuQV?= =?utf-8?q?govIKUlDagMXdoF3ERq62TO3VDGRAS1Q6ZX7Yvb8ktaX1TSEgDPfjnzGl24bdrp72?= =?utf-8?q?QoBK5begmOY3D4q3caaHJuMXbw3W1vZN9FwD5QuFNSUBCHc/5P421i6phev23H+Ee?= =?utf-8?q?1ibuFsZpt4V0/rLEINk6oxFiu8kd91V8Ef8jfTiL668Mn26KJbjxazKhZYg/n2WQQ?= =?utf-8?q?M1wIclRnpjXBCuofm8/8coZWEUNH/Xh2OgiiPQ2F6pluxNtVuj44A+q4smouk1ptN?= =?utf-8?q?ThVyepkj/cuR8pc2kyOU1d877myPpYZCxlhID/TqR7uxxVoAQUYCNP2UpLbGT8JIs?= =?utf-8?q?RHFVEPTCYFoAJawRdgwR4vIHrTDHgXxuV9rspLHFjEb9T1C0UPnJuZUvz2ijnHJGt?= =?utf-8?q?+HSuR+qV4sWiuTsc3AArl8KAWcZLEwICgDERDLPJpiMOwZfPzvhn9LJEZ4d/0sq0w?= =?utf-8?q?9VWRjX++j2mZbY3gYGpkCFfOnefqvV/z6EICK2hDRFVEzAndglT3P223CrQVy9RlN?= =?utf-8?q?3iL+4iGWJLsPV2HXSJWZtvZEayxipJVFWA8I1k8ikKON5Y1EzKuxhMmBbgc1T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8?q?/q2OjcAcaPDc?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ecd1a3c-2dd3-4100-a5cc-08db449654a2 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2023 07:34:26.0829 (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: CtxXnqczmlMSAcPWofXr/LRi5NLSNe5vs7U+bj0OEmyDcJfSOfe5yXfvCE+Qma8f4ZCSCPHTiKA5Raa1PwzdkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8311 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 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?1764042136217112442?= X-GMAIL-MSGID: =?utf-8?q?1764042136217112442?= For quite come time print_insn() has been storing the address of a local variable into info->private_data. Since the compiler can't know that the field won't be accessed again after print_insn() returns, it may kind of legitimately diagnose this. And recent enough gcc does as of the introduction of the fetch_error() return paths (replacing setjmp()-based error handling). Utilizing that neither prefix_name() nor i386_dis_printf() actually use info->private_data, zap the pointer in fetch_error(), after having retrieved it for local use. --- Let's hope that this addresses the observed issues, which I haven't been seeing myself. And of course there are further return paths which may (sooner or later) also have such a warning trigger. --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -345,6 +345,12 @@ fetch_error (const instr_info *ins) const struct dis_private *priv = ins->info->private_data; const char *name = NULL; + /* Our caller has put a pointer to a local variable in info->private_data + and it is going to return right after this function has returned. Some + compilers diagnose this as a dangling pointer. Zap the pointer here to + avoid needing to do so on all involved return paths in the caller. */ + ins->info->private_data = NULL; + if (ins->codep <= priv->the_buffer) return -1; From patchwork Mon Apr 24 07:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 86886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2564113vqo; Mon, 24 Apr 2023 00:35:16 -0700 (PDT) X-Google-Smtp-Source: AKy350bDt7bI0F/yhmAGCBeJ49mFXYGu7r37a9gNyoy1IeJAeN4raGDhZWlMyvGnZtzIg4XphoV1 X-Received: by 2002:a17:906:4915:b0:94a:5d16:a280 with SMTP id b21-20020a170906491500b0094a5d16a280mr9784323ejq.9.1682321716125; Mon, 24 Apr 2023 00:35:16 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b15-20020aa7cd0f000000b00506c3ce3b23si5843270edw.400.2023.04.24.00.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 00:35:16 -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=CY2Cgc6P; 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 DA66F3857714 for ; Mon, 24 Apr 2023 07:35:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA66F3857714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682321713; bh=KEGFJ0YIomtzMR1vye+IRM0ebSBNK1Saxi5XtiVuUgo=; 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=CY2Cgc6Pubr/LZXTVf4PjamcI7n9eV4lmo6dpou2UfwXBHVF9V9eA/kMHh5T4yjBL m8aUonRjw3mVmFwMpU7jha7a8U3kGb/LY7G2GsCWngrpbeLyKiGiQTNT7ioSIRzZaU Q2WGrU3wN9KqKIds9W8uXs8qQukfcxlAeZnfFSvQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2059.outbound.protection.outlook.com [40.107.6.59]) by sourceware.org (Postfix) with ESMTPS id 009283858426 for ; Mon, 24 Apr 2023 07:35:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 009283858426 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXZBBr6z+MIN2O1RJbTOWAaoQaYqKBsry5N6SxxPQy02euN6llJnRjRrKmUoYbzcDG8VV0oGrIJx6jqSTQorD9Ic94IyoDYK5dl5rHz+S/S1TAWVmgzdXs7/hGsOgfQt6KuDWVkkOWkNioIaEc7TzzSulumBMDcy+MMUuw5lsWY5MtCGiLAw2gM+sJB972LZidUjs6MS5g4BznZme1jYLTqBRhhklZ8DdroD2+UH27DkTKzvPfyPz40jfI98Qi3bB+ephWo9f7xKrWXcHu8J3+2mmkRixZN7FU4o/noAInW6zl4cGFLXYVR8boVVVh7cYVOofZJL8T6tHqSHziitrg== 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=KEGFJ0YIomtzMR1vye+IRM0ebSBNK1Saxi5XtiVuUgo=; b=HGAjWPY8n2E6UyeB0q2PK3HEu0XRXbggzJPl7S3YaQ99QWDgHcrdiz1mmUSYw+rT6KH/Me0pOKtXUFU7JiVcnqUacQPH+/Lmjg9uz6utrTaTPDtkEwUzprmAF3zZjIQciqrxM+iIFH/vakHXOXBNmxx+joygHDynuIDhhGj5boyEh/2/UVYie5aNDFoXRrsnc5UZvDgXce33UU1KOuiowxXeKIE+H4ymAxXFf37uGSvM+LAfY/O6JgWxuObOwvAeGL4xkGHHKFX4/BHapeGIfv938um+mhEs1tqACCBKVst48m6xlDahB9yHqBtaB8QdB2Sgv/0ghxQgSfu8VGZzWA== 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 DB9PR04MB8156.eurprd04.prod.outlook.com (2603:10a6:10:246::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Mon, 24 Apr 2023 07:35:04 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae%2]) with mapi id 15.20.6319.033; Mon, 24 Apr 2023 07:35:04 +0000 Message-ID: Date: Mon, 24 Apr 2023 09:35:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH 2/3] x86: limit data passed to prefix_name() Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> In-Reply-To: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> X-ClientProxiedBy: FR2P281CA0107.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9c::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_|DB9PR04MB8156:EE_ X-MS-Office365-Filtering-Correlation-Id: b857a49d-751c-4253-5141-08db44966b3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bz/8ih93+LZlnfDhd6tVR/bTquyIoiGoXNaukrPm8O4P49oAh7sKbyzT4+ZjnViYg/s0f01Nud/MNXBznfqRi7i6W5DK34SDGcz3mysPhnuM1N6UI+b/cUnnSq46ZVRTQyKDMR9Swc7dG8jeY5Po3V7M3eymEPr6FWc4pQOIiB4D4kwQppTE8iwMFXaF56UfVfVj8aJqLXl00y9Akud7/O1WzqHhp6nN7a31TjtxQxKWFwX05ojmw3cNYzcOWpxFdCcE2QTN19reQapjGc4BQsSYLZ/XxK+3BaqCeLIB44j6XbnFm5Kkzvu7uQrwXlFvAlOpvKwui4CTxpaxtHeEIOkfyLiKOJgZZqwMJepRX6Oh+fGtjU2GQDDzu14J4tboZM/nMAQF2dX/24uEk0vxKrdogTgaFqPBRyL4O8tzpOIsIpHG2gtvOWPJBWjOlGAu3+d44ZY+Ut8D/GezL5L0R82LAkC0deiZNfGoe07e842jPtEbaMjJGfcbzjLsSnYX19XaP/vNgGNPJ+htTUJfQnhmsKV0rWoaLPXykJeg9H/CLfBM8J4vKh6IESivljdL8pmGJQMwyOmqNwjsHUc8Z7hws5ClVNYOaOHVvM/Ub3S1S/Y9BD5n/iX/+X+qcmIppbaZ7kMn6Hi3ltV6B6zomg== 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:(13230028)(396003)(376002)(346002)(136003)(39860400002)(366004)(451199021)(2906002)(6486002)(2616005)(6512007)(6506007)(26005)(186003)(66946007)(66556008)(66476007)(8676002)(8936002)(316002)(41300700001)(6916009)(4326008)(478600001)(5660300002)(38100700002)(36756003)(86362001)(31696002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sUvfmF8Zwbj8BgemeIPtjyafW8wj?= =?utf-8?q?qywDVWDlJE3a8vvn76OWd8tfjtJLVsFP5zQHHWFqvRAnsK4y61HCYqAZW6XJ7pRcY?= =?utf-8?q?IoKWL79uMFP6fpZmA1HSav0/MLZoaGsmcfP4cR/VNIpxbW1kx6c+kELPlXj7ZYn5p?= =?utf-8?q?4b0XlHwrutvNJcItVTCkqptWzr7ps+I8aFc71IcMA9jNbf1bATuwMb+MNhdpGnrC9?= =?utf-8?q?ki535nZjsWDB9+SOje6AoC2WtUUXfQ7M2CS2bIlugAke0SI1kTXLVKaK//CXf0+Rn?= =?utf-8?q?BY9iolaJSa/YiamD+WhZWhiugo5KbHVpyq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xBdPjMshR4HNhdUu7LnY5c5?= =?utf-8?q?c7jowkUn5ZzzDxUQV0apJCB42n5FPLqV0aWtdCPym3CNlZIEomI4hCKrANpg80Ie4?= =?utf-8?q?0hBZDul2nHsHW66640QxMadIwLdi0kfKrCjmu/xQH/1lNbpKyq0jncvSaq8vvOgiP?= =?utf-8?q?z2Jld4vl/I9KqzS3QYnTNqOmWwZdYpUWPB17Y19cNSqGdUSBHOAxRjR34B0SLzwol?= =?utf-8?q?8suYLhMtoZDb6oEnaKi75BRH/6WddKCbDzY7ZJzLOh9nLON0m+3I6vKV5GFpROlcX?= =?utf-8?q?qHYVYkIQgW3VFm1JlrDtuh1ft1MzOKGwZsA82vBXcoU+y00/q8T+Hb/o8JeEKA9ah?= =?utf-8?q?8UlZsRLvcD/W?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b857a49d-751c-4253-5141-08db44966b3a X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2023 07:35:04.0424 (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: 3DwFlmpmEmr9fZr8JaLYzT1TOarPglT1UhtUjpJl3vWmNWJasASbZB06HGOWNNBiqJSnQwA6QDy5HyQflUQkNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8156 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 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?1764042175907629304?= X-GMAIL-MSGID: =?utf-8?q?1764042175907629304?= Make apparent that neither what "ins" points to nor, in particular, that "ins->info->private_data" is actually used in the function. --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -117,7 +117,6 @@ static bool PREFETCHI_Fixup (instr_info static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const instr_info *, enum disassembler_style, const char *, ...); -static const char *prefix_name (const instr_info *, int, int); /* This character is used to encode style information within the output buffers. See oappend_insert_style for more details. */ @@ -141,6 +140,8 @@ enum address_mode mode_64bit }; +static const char *prefix_name (enum address_mode, int, int); + enum x86_64_isa { amd64 = 1, @@ -355,7 +356,8 @@ fetch_error (const instr_info *ins) return -1; if (ins->prefixes || ins->fwait_prefix >= 0 || (ins->rex & REX_OPCODE)) - name = prefix_name (ins, priv->the_buffer[0], priv->orig_sizeflag); + name = prefix_name (ins->address_mode, priv->the_buffer[0], + priv->orig_sizeflag); if (name != NULL) i386_dis_printf (ins, dis_style_mnemonic, "%s", name); else @@ -8928,7 +8930,7 @@ ckprefix (instr_info *ins) prefix byte. */ static const char * -prefix_name (const instr_info *ins, int pref, int sizeflag) +prefix_name (enum address_mode mode, int pref, int sizeflag) { static const char *rexes [16] = { @@ -8991,7 +8993,7 @@ prefix_name (const instr_info *ins, int case 0x66: return (sizeflag & DFLAG) ? "data16" : "data32"; case 0x67: - if (ins->address_mode == mode_64bit) + if (mode == mode_64bit) return (sizeflag & AFLAG) ? "addr32" : "addr64"; else return (sizeflag & AFLAG) ? "addr16" : "addr32"; @@ -9767,7 +9769,8 @@ print_insn (bfd_vma pc, disassemble_info i++) i386_dis_printf (&ins, dis_style_mnemonic, "%s%s", (i == 0 ? "" : " "), - prefix_name (&ins, ins.all_prefixes[i], sizeflag)); + prefix_name (ins.address_mode, ins.all_prefixes[i], + sizeflag)); return i; case ckp_fetch_error: @@ -9788,7 +9791,8 @@ print_insn (bfd_vma pc, disassemble_info for (i = 0; i < ins.fwait_prefix && ins.all_prefixes[i]; i++) i386_dis_printf (&ins, dis_style_mnemonic, "%s ", - prefix_name (&ins, ins.all_prefixes[i], sizeflag)); + prefix_name (ins.address_mode, ins.all_prefixes[i], + sizeflag)); i386_dis_printf (&ins, dis_style_mnemonic, "fwait"); return i + 1; } @@ -10025,8 +10029,9 @@ print_insn (bfd_vma pc, disassemble_info for (i = 0; i < (int) ARRAY_SIZE (ins.all_prefixes); i++) if (ins.all_prefixes[i]) { - const char *name; - name = prefix_name (&ins, ins.all_prefixes[i], orig_sizeflag); + const char *name = prefix_name (ins.address_mode, ins.all_prefixes[i], + orig_sizeflag); + if (name == NULL) abort (); prefix_length += strlen (name) + 1; From patchwork Mon Apr 24 07:35:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 86887 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2564673vqo; Mon, 24 Apr 2023 00:36:47 -0700 (PDT) X-Google-Smtp-Source: AKy350aJcbxvEgGNjZa4vZotjTLK8YHXBpenMv1QdrfiFQaW1Xu3e72TR3v5fMeaPuCFYCgfqdo0 X-Received: by 2002:a17:906:ce55:b0:931:624b:680c with SMTP id se21-20020a170906ce5500b00931624b680cmr8266667ejb.29.1682321807175; Mon, 24 Apr 2023 00:36:47 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n21-20020a05640206d500b005021f0d5758si7870077edy.671.2023.04.24.00.36.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 00:36:47 -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=cNUfBzE0; 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 135DF3857723 for ; Mon, 24 Apr 2023 07:36:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 135DF3857723 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682321775; bh=lX/Vqw+0EZuRCFknc6e5XcYGTHDyesuXxb6fsYJnWeU=; 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=cNUfBzE0t1c/UsUBSnAP5eD7E45V47jSxLbztC1QVGp1v8ku+ej6EilBAqoi4V+IF kJ2CBAlwkJc8yioGx40dgcCpzKQs9DAtOiF8IbYZbgk68jNILnnCs3kxF2fk9CugO0 pjEcP7dAqO1YAOd0ZC30Yp08WMjjPcrfriEtt+SQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2088.outbound.protection.outlook.com [40.107.6.88]) by sourceware.org (Postfix) with ESMTPS id 3A973385771A for ; Mon, 24 Apr 2023 07:35:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A973385771A ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TdTMzUOWLw3jJbuIuYth6zL0s+x8VNisM+gb4NLrOjgNdzCX9V4jnAcPK79boo/vSlACvZ5rJvqrODIft4LVUvhmeWXAYJHM8IB7fxHUqx+u47wM84pc6wxZgb/t29GhrTqaPigtuc4YsnZKNShx4jrcuhdPJVVXCSEHrDAubjvMKOKz99xObz7rapT8qG06nR66iC4nbTmctxq+kVsmLDibweISQczArSVwBaCCa9KOQi2tIviVBzonrgV8IwwynmVDrki4FQbE5Ufn4+Vi1mdjRi5wvcvujzcgyI3RWtP9NsCFNe+NdXb7QyaObeAXwwggclBmXgbfBpziMT1SCQ== 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=lX/Vqw+0EZuRCFknc6e5XcYGTHDyesuXxb6fsYJnWeU=; b=AfC2M+NCwFakqOoGknHtkEEa5JoCfW53I8+dQQAuzh2AEiVTWzbctSkJ+b3Czt+FcfmYyvWni3wJRP0rSlFEHjDaHcGZh1RdxY6zbRlXinBLfYS3TxOaKy9okUPyOLe/5GOqGEzmEhYO6KY5VWMhcrVRcO8pMEuQ5WbrWoh8AuJCXmjl5ZJ99RGWkr9hNEvP5OqIspXaKvsa8pqqaQP7Yxjet+otRFGbNxCtkb9HlNaZIgtkG9tkElzSI37cyxOS20tCKI2WckURS57xHZqQCAZTC8NuvmoqYKtf8Kw/rp9/zubV2JPP6S0Oh5C8Dmyd+ImJMCiQ2qp73t9pkSAVqA== 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 DB9PR04MB8156.eurprd04.prod.outlook.com (2603:10a6:10:246::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Mon, 24 Apr 2023 07:35:27 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae%2]) with mapi id 15.20.6319.033; Mon, 24 Apr 2023 07:35:27 +0000 Message-ID: Date: Mon, 24 Apr 2023 09:35:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH 3/3] x86: limit data passed to i386_dis_printf() Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> In-Reply-To: <61597ebf-cc5e-2029-6520-31f7adfeea68@suse.com> X-ClientProxiedBy: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DB9PR04MB8156:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a399837-52c7-475c-273b-08db449678f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eGId8SbtNOHNobT7tukYUZXmfzqRbc808Tx9b3wbWlt94C/As4I3Z1TC3tuGKWl/jWTo7ooQeM+UJbx8m14zkpARu+4X9EWeAFCa24K7d3O44yop+k8Do5hc+7jtb0wK5qBCx7BUs3Zk6jhKChLb2FBM+o5rp0RnEhYc/eFLhyjDVRkjF9G4wQD4qAQDIeGOHAK+wIgorL04bmdeg65PCdmbp7tzI4K0xV5pXr15UpY3Ijgj2cqr/ezKfh4S8JfFbGYKxy7xe67lq7/nLFPrm2BRIbFjMbUyRFTPFXqrVSzQqpRPYBRFYDv1rFIHHy63R6kS06iJ9gJgZ9SlfPLJk6NKIHDgYyrf5yK58ujvpw0vbnkNoxbx12CXNP/KZD7KFYfr/0KBvwXFsOp3Ni6bdeD6sAUTJ7t33BCKipaPD74EQrLj9IyoufIBE0IkJ9X6UinxFxPmBHk6SQXsEav6j6bFp2qm+8AippoaCd+FogXgI2Z+e+LqrJ9ps5FLoR0E7M1nrJ4is2CWNrGx5z4NCkcMg4z73fnt+lri55wqShZuFG0/DNTaSjyR0hsMx8ZIQpVRURxG02YB5FJm2dcq7gFRQwiEXJ0UWOgTPJXD0m4RBYczhNnxmGL9q3+eCTFttmigNiI6Mn/tkLg6/o5uuw== 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:(13230028)(396003)(376002)(346002)(136003)(39860400002)(366004)(451199021)(2906002)(6486002)(2616005)(6512007)(6506007)(26005)(186003)(66946007)(66556008)(66476007)(8676002)(8936002)(316002)(41300700001)(6916009)(4326008)(478600001)(5660300002)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ikm21ahZBMO3pjhJ0/H0WH1uZ/VW?= =?utf-8?q?Q+2+K8ijG3A5+7GRnK4VzsmgswWqfATKAQueASglT/rJUBbCCJ2FWM933NnH9+W2s?= =?utf-8?q?4adv5ainnnpI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I3dz+JOIoeA5gjzYujnZii91Nd/34Apdd7bmmavpUIO?= =?utf-8?q?8vJuCviy/SVdLYWC8RIjd4dQPdlVwalQ9sNQlY9H1nnfFOuz7QCGaCUANDXadjoo0?= =?utf-8?q?5b12MYVv9PnOm4+U1tVPqIh6R3HdybBqX5I6NUwRZiHgpKECbbdM+5C3B0fbDLD5L?= =?utf-8?q?A13DPO5uQZ/dLD+bYSXlLD2TVoM2ZEx1mc1KJaNFvoPGfnjguxHWZ2zKimNLGf2MZ?= =?utf-8?q?m3AtOmUZBT7KfEfcEMq9JYfNFxnbR/O/kO1972iXus+l5Tea9LYG8b73if7IeH8wf?= =?utf-8?q?DDfj29UC5k9u4kh28kepGBQNtR7D27f/8gjuZ4Yjzzo2Uy258OyJwLq7p0I1W0n8H?= =?utf-8?q?rw/HcP6kbN4U75w52gQj8J2XgrAZHwoH0tUUsWKynIvCMOAleMfFsUAWbymY6aU7I?= =?utf-8?q?Wlq+Q4Z4Z6VlXYWbdgCBXgl2dZ94jeOPoEShx54BwUJzBWUXBLl+/Ojfshz/jrcmc?= =?utf-8?q?hTvuPD9yInnw7QZmnonweQLisVXYNgE99seDM8fdESZ32hUnbBw9VPAppQePiiPUX?= =?utf-8?q?lYlvG/AdR56D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a399837-52c7-475c-273b-08db449678f9 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2023 07:35:27.0505 (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: rNiGhkEVOJAraL3rNqdiphw76GNYkUkl0UFz2G25RnmR4jdJC7L4PykZ1meYgB5bbnQtxH0RDZdTTMJfSKEJLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8156 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 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?1764042271336427131?= X-GMAIL-MSGID: =?utf-8?q?1764042271336427131?= The function doesn't use "ins" for other than retrieving "info". Remove a thus pointless level of indirection. --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -114,7 +114,7 @@ static bool MOVSXD_Fixup (instr_info *, static bool DistinctDest_Fixup (instr_info *, int, int); static bool PREFETCHI_Fixup (instr_info *, int, int); -static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const instr_info *, +static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const disassemble_info *, enum disassembler_style, const char *, ...); @@ -359,12 +359,12 @@ fetch_error (const instr_info *ins) name = prefix_name (ins->address_mode, priv->the_buffer[0], priv->orig_sizeflag); if (name != NULL) - i386_dis_printf (ins, dis_style_mnemonic, "%s", name); + i386_dis_printf (ins->info, dis_style_mnemonic, "%s", name); else { /* Just print the first byte as a .byte instruction. */ - i386_dis_printf (ins, dis_style_assembler_directive, ".byte "); - i386_dis_printf (ins, dis_style_immediate, "%#x", + i386_dis_printf (ins->info, dis_style_assembler_directive, ".byte "); + i386_dis_printf (ins->info, dis_style_immediate, "%#x", (unsigned int) priv->the_buffer[0]); } @@ -9528,7 +9528,7 @@ oappend_register (instr_info *ins, const used in the next fprintf_styled_func call. */ static void ATTRIBUTE_PRINTF_3 -i386_dis_printf (const instr_info *ins, enum disassembler_style style, +i386_dis_printf (const disassemble_info *info, enum disassembler_style style, const char *fmt, ...) { va_list ap; @@ -9569,9 +9569,8 @@ i386_dis_printf (const instr_info *ins, { /* Output content between our START position and CURR. */ int len = curr - start; - int n = (*ins->info->fprintf_styled_func) (ins->info->stream, - curr_style, - "%.*s", len, start); + int n = (*info->fprintf_styled_func) (info->stream, curr_style, + "%.*s", len, start); if (n < 0) break; @@ -9722,7 +9721,7 @@ print_insn (bfd_vma pc, disassemble_info if (ins.address_mode == mode_64bit && sizeof (bfd_vma) < 8) { - i386_dis_printf (&ins, dis_style_text, _("64-bit address is disabled")); + i386_dis_printf (info, dis_style_text, _("64-bit address is disabled")); return -1; } @@ -9767,7 +9766,7 @@ print_insn (bfd_vma pc, disassemble_info for (i = 0; i < (int) ARRAY_SIZE (ins.all_prefixes) && ins.all_prefixes[i]; i++) - i386_dis_printf (&ins, dis_style_mnemonic, "%s%s", + i386_dis_printf (info, dis_style_mnemonic, "%s%s", (i == 0 ? "" : " "), prefix_name (ins.address_mode, ins.all_prefixes[i], sizeflag)); @@ -9790,10 +9789,10 @@ print_insn (bfd_vma pc, disassemble_info /* Handle ins.prefixes before fwait. */ for (i = 0; i < ins.fwait_prefix && ins.all_prefixes[i]; i++) - i386_dis_printf (&ins, dis_style_mnemonic, "%s ", + i386_dis_printf (info, dis_style_mnemonic, "%s ", prefix_name (ins.address_mode, ins.all_prefixes[i], sizeflag)); - i386_dis_printf (&ins, dis_style_mnemonic, "fwait"); + i386_dis_printf (info, dis_style_mnemonic, "fwait"); return i + 1; } @@ -9939,14 +9938,14 @@ print_insn (bfd_vma pc, disassemble_info are all 0s in inverted form. */ if (ins.need_vex && ins.vex.register_specifier != 0) { - i386_dis_printf (&ins, dis_style_text, "(bad)"); + i386_dis_printf (info, dis_style_text, "(bad)"); return ins.end_codep - priv.the_buffer; } /* If EVEX.z is set, there must be an actual mask register in use. */ if (ins.vex.zeroing && ins.vex.mask_register_specifier == 0) { - i386_dis_printf (&ins, dis_style_text, "(bad)"); + i386_dis_printf (info, dis_style_text, "(bad)"); return ins.end_codep - priv.the_buffer; } @@ -9957,7 +9956,7 @@ print_insn (bfd_vma pc, disassemble_info the encoding invalid. Most other PREFIX_OPCODE rules still apply. */ if (ins.need_vex ? !ins.vex.prefix : !(ins.prefixes & PREFIX_DATA)) { - i386_dis_printf (&ins, dis_style_text, "(bad)"); + i386_dis_printf (info, dis_style_text, "(bad)"); return ins.end_codep - priv.the_buffer; } ins.used_prefixes |= PREFIX_DATA; @@ -9984,7 +9983,7 @@ print_insn (bfd_vma pc, disassemble_info || (ins.vex.evex && dp->prefix_requirement != PREFIX_DATA && !ins.vex.w != !(ins.used_prefixes & PREFIX_DATA))) { - i386_dis_printf (&ins, dis_style_text, "(bad)"); + i386_dis_printf (info, dis_style_text, "(bad)"); return ins.end_codep - priv.the_buffer; } break; @@ -10035,13 +10034,13 @@ print_insn (bfd_vma pc, disassemble_info if (name == NULL) abort (); prefix_length += strlen (name) + 1; - i386_dis_printf (&ins, dis_style_mnemonic, "%s ", name); + i386_dis_printf (info, dis_style_mnemonic, "%s ", name); } /* Check maximum code length. */ if ((ins.codep - ins.start_codep) > MAX_CODE_LENGTH) { - i386_dis_printf (&ins, dis_style_text, "(bad)"); + i386_dis_printf (info, dis_style_text, "(bad)"); return MAX_CODE_LENGTH; } @@ -10065,7 +10064,7 @@ print_insn (bfd_vma pc, disassemble_info i = 0; /* Print the instruction mnemonic along with any trailing whitespace. */ - i386_dis_printf (&ins, dis_style_mnemonic, "%s%*s", ins.obuf, i, ""); + i386_dis_printf (info, dis_style_mnemonic, "%s%*s", ins.obuf, i, ""); /* The enter and bound instructions are printed with operands in the same order as the intel book; everything else is printed in reverse order. */ @@ -10120,7 +10119,7 @@ print_insn (bfd_vma pc, disassemble_info break; } if (needcomma) - i386_dis_printf (&ins, dis_style_text, ","); + i386_dis_printf (info, dis_style_text, ","); if (ins.op_index[i] != -1 && !ins.op_riprel[i]) { bfd_vma target = (bfd_vma) ins.op_address[ins.op_index[i]]; @@ -10136,14 +10135,14 @@ print_insn (bfd_vma pc, disassemble_info (*info->print_address_func) (target, info); } else - i386_dis_printf (&ins, dis_style_text, "%s", op_txt[i]); + i386_dis_printf (info, dis_style_text, "%s", op_txt[i]); needcomma = 1; } for (i = 0; i < MAX_OPERANDS; i++) if (ins.op_index[i] != -1 && ins.op_riprel[i]) { - i386_dis_printf (&ins, dis_style_comment_start, " # "); + i386_dis_printf (info, dis_style_comment_start, " # "); (*info->print_address_func) ((bfd_vma)(ins.start_pc + (ins.codep - ins.start_codep) + ins.op_address[ins.op_index[i]]),