From patchwork Thu Nov 17 13:29:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 21663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp399132wrr; Thu, 17 Nov 2022 05:29:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf555jLmDly/DDwwMqygDiiI4YHbvDNkbeA3XtuPk++ZYKdCwVTQNiZlxOGUbJrF893Qm7si X-Received: by 2002:a17:906:708d:b0:7ad:b45c:dbe7 with SMTP id b13-20020a170906708d00b007adb45cdbe7mr2056407ejk.617.1668691794004; Thu, 17 Nov 2022 05:29:54 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cx27-20020a05640222bb00b00461b96334eesi721717edb.500.2022.11.17.05.29.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 05:29:53 -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=VBdI6Swm; 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 2F5123AA803E for ; Thu, 17 Nov 2022 13:29:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F5123AA803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668691792; bh=JoXbqPYlHofEfIQbYoKkcFyaHol3zF6eViy0Yzk7Svk=; 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=VBdI6SwmsnVGw9/bxWPIeE/6DFSDZZ8tKhm624AVNl6zRvCuwBR6VGhLA8xIJTVw0 nnae1FPn+NUAkaS4AkodrW/JHTdyhWLq7k4HsySLlrORB9BbNRGmgRz4f0adOBXPTn oQW3tfNFGO2hUQHbgpro3onHx3cLUtpFQwYrgSZc= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) by sourceware.org (Postfix) with ESMTPS id C12B639960EB for ; Thu, 17 Nov 2022 13:29:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C12B639960EB ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R0d6LgVJPiO3LFMxQrMxtpX675HCLkARlEapKUZOobRzvPLhgqxjj4wplvMxe5RNn/IkbMgE0qr2hABaGK6iRf71yFtFsfLQ+z0PLo5YqMpJnveNBpzCb/HKMo0C1+rRDmjTgTUQ62DJNQeOu4XAfN7tbD/iX5J7zDxBwTnhy2Vu1bfNN93SyhbkzSKDzrOotg6UGkvgBeS9xSFQEaMsaWN/+CDfCkLi1sAVDpsJu5zIeg0yhdEIxpoftEq80xZGbX+sS5DyczWQJLIy7hWWKUYkgoRKeMpUAp7rbLjqo5LNeoocLQ5nDLlA9k7YCq1JdGdcdX8zHFigOEUV+KE0oQ== 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=JoXbqPYlHofEfIQbYoKkcFyaHol3zF6eViy0Yzk7Svk=; b=AnOzJg8IJicDgOYW0qq+B0ttufEbSFiq6wVvyNMZiMj0/yRFXH3JhdmIw/PShU9wIdvXEQNVFbofpondv0l2HTmDfx22ILWRsbG6mivNgshn7ielRy+l36kGhbB+se9rsFbqNUGDxYHPtjV6C164xv+MO38xdEfQ6+0TjMe3rtjItuRYDI91LNrdHozxlhTxfh5UxB1bgwMIysMcUvODDi7xYS7CWRRxIEiOgRkRCfd84m1SbZkdqXd/tClyLe/eUte/GQN/NcO4hsiMjwjXot8DSwz3R7v1Pc2V/HAsHjKhAiO8ls+ICGmiITmFwPqzNEgdTm0uLFXJJVJE8hJv9Q== 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 AM8PR04MB7988.eurprd04.prod.outlook.com (2603:10a6:20b:24e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12; Thu, 17 Nov 2022 13:29:37 +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.5813.018; Thu, 17 Nov 2022 13:29:37 +0000 Message-ID: Date: Thu, 17 Nov 2022 14:29:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: [PATCH 2/2] x86: break gas dependency on libopcodes Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <5c07cdb4-ec26-c7bf-087a-4d0c75ef8549@suse.com> In-Reply-To: <5c07cdb4-ec26-c7bf-087a-4d0c75ef8549@suse.com> X-ClientProxiedBy: FR2P281CA0166.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::13) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AM8PR04MB7988:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e0fe7ca-3fd6-43c3-0e91-08dac89fc615 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j/mzcSz/vG0twUF6QeORpQtX6l7p/vVgfWW96GgRXDNxWaIlUxBhwmjqn9FcqYNz0MVFahEtttSFDaOP8p91Dqa0iiR+oh8sOIDwB/+JNNRzGBth1wNaBINk3ukJ1s8AIcXFeizaGC5XlWn2GKBKVDBnoa6CIh34jq2EMz64k0HaaPBuzUqW4nPq6ckPXHpW19nxNDlMwbnmV6ZX8BPMXo/ShrOPBGuKF0VmfjmTvrTWBkmIZfZInksF893HHh85YtknlYT59Cccd7op5Fkdc1ENvgHwKxo+uWRwvoY+Loag8TWUTr0gD3ruIZnfqG1qi74sqTxNoKcABaQbjr+mnyAV2wzNo/t89UgdK7MYjX69WzPSYaEXXkObC8ySTRsyWiHUq3qsze4h4xrZ9YYirxfGjYyKFlN5t5/22SIVa3mAmOCwEycpfz+aHmfKGbhoTa8Wr0Eeu4d+KJrNEPjp6XI5LOHbB6VA6O7BDXCN2U10OEv3f7/Z7+BhelkNUM0rwO834lOYUZBOECum2jg2MCUAkXv2bOUqyh77wwHLNTWs3TV4li2gVxDeygNf6mkVDX7Ja5kuViGK7sLEKMx0Cg6kWQVrLwa/wWgoIafRwwwFod9S7BC/Jxw2avExE+tV4TWE+ZNDNi23eO9GLJ+Rh1/DGuMYSskQ9JW5g5Ba96EOxGrYLokrf5QXz/alxjy4yTHJC6qTw61roNDGeaiQ9/MkmdFcET9aa1v7VmVxxecYzDRvejfRgrCiDo0tLGvH 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)(346002)(366004)(39860400002)(396003)(376002)(451199015)(478600001)(31686004)(6486002)(86362001)(66476007)(2616005)(66556008)(66946007)(41300700001)(26005)(6512007)(8936002)(186003)(316002)(5660300002)(6916009)(4326008)(6506007)(2906002)(31696002)(8676002)(36756003)(38100700002)(2004002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xBCJSmHzTktffwija4BXGb7wFMz/?= =?utf-8?q?4GNS9MztWoeCm61z5lYvtSfZZionJbbpfqSN0VqadZs3ubSTI6CwbnWMgCpclppEC?= =?utf-8?q?KueYWuke0O4eeu1GdIWC/eIEbldTq/AVkP3+OrRiGmcj7j69opU5HimJXCKtYUPRu?= =?utf-8?q?HhkVtBgqF/nyKCJWlgptTf1AlNb/jGD6f7Z5AqZDZrCCWLPb239pq5t0m0axuvN8Z?= =?utf-8?q?oUaw76myLsGc+JWa8s6psXZn418Uc5hgXCdV8lNAxywbuwgWZFy1jYukIi9cNaxTX?= =?utf-8?q?XkH3JJOySZexRzjn28oudY/R2HS2zqisgPmwTm0Im89/QlIciQL0pr4ztoCHazym9?= =?utf-8?q?PLO6x1t662bpBRmownylqRaRabwMZzxFcoZpFXTd7jAOamNCqnDd+V82gxpOjAKPh?= =?utf-8?q?izvljR2zBwtTBDm165Npj2hZMPHqd4xt1YCXbO07argvgCFseTQZnABAsXgs/kUB3?= =?utf-8?q?J1o/kp634Mpc7XHThWk0+zVWdxAdEwjo1WUb1/cTd+io+vi8vPTOCH4D0nuck0Er3?= =?utf-8?q?K/uwK/OQmUuBuLAcBIM79WIs/jJINXqS0hCva3XX1dtMp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TcCMNoXVk402lVxKgLiE3ic?= =?utf-8?q?H3g61OEGTg+V8TPLDQAC8eFWptBT5sLUKs8P4M91do3OHUTUDdNK8kOq0W1SQyZQ7?= =?utf-8?q?QwoGVUsN7EAq?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e0fe7ca-3fd6-43c3-0e91-08dac89fc615 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 13:29:37.6064 (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: mm4QQLdjoN405bYvyQEslfptonpAC+JlmPnR6+UhkJD2AWjpwE1LUZv91WNkJ404otPm3iNtX38d5KQE9JvMZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7988 X-Spam-Status: No, score=-3029.3 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?1749750038739366062?= X-GMAIL-MSGID: =?utf-8?q?1749750166928224426?= The only item gas still consumes from libopcodes is i386_seg_prefixes[], which again is used by gas alone. Move it into the assembler, allowing to remove the linking in of libopcodes. To compensate, tie table generation in opcodes/ to the building of i386-dis.o, despite the file not really depending on the generated data. --- RFC: Is there a better way to specify extra dependencies, such that table generation and compilation of i386-dis.c could be kept separate (and hence processable in parallel)? --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -445,6 +445,16 @@ struct _i386_insn typedef struct _i386_insn i386_insn; +/* To be indexed by segment register number. */ +static const unsigned char i386_seg_prefixes[] = { + ES_PREFIX_OPCODE, + CS_PREFIX_OPCODE, + SS_PREFIX_OPCODE, + DS_PREFIX_OPCODE, + FS_PREFIX_OPCODE, + GS_PREFIX_OPCODE +}; + /* Link RC type with corresponding string, that'll be looked for in asm. */ struct RC_name --- a/gas/configure +++ b/gas/configure @@ -12263,7 +12263,7 @@ _ACEOF # Do we need the opcodes library? case ${cpu_type} in - vax | tic30) + vax | tic30 | i386) ;; *) --- a/gas/configure.ac +++ b/gas/configure.ac @@ -420,7 +420,7 @@ changequote([,])dnl # Do we need the opcodes library? case ${cpu_type} in - vax | tic30) + vax | tic30 | i386) ;; *) --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -162,7 +162,6 @@ TARGET32_LIBOPCODES_CFILES = \ h8300-dis.c \ hppa-dis.c \ i386-dis.c \ - i386-opc.c \ ip2k-asm.c \ ip2k-desc.c \ ip2k-dis.c \ @@ -564,7 +563,7 @@ $(srcdir)/i386%tbl.h $(srcdir)/i386%init # While not really dependencies, specify i386-{init,tbl}.h here as well to # make sure they are re-generated as necessary. -i386-opc.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h +i386-dis.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS) $(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS) --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -554,7 +554,6 @@ TARGET32_LIBOPCODES_CFILES = \ h8300-dis.c \ hppa-dis.c \ i386-dis.c \ - i386-opc.c \ ip2k-asm.c \ ip2k-desc.c \ ip2k-dis.c \ @@ -947,7 +946,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h8300-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppa-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-dis.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-opc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64-opc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip2k-asm.Plo@am__quote@ @@ -1539,7 +1537,7 @@ $(srcdir)/i386%tbl.h $(srcdir)/i386%init # While not really dependencies, specify i386-{init,tbl}.h here as well to # make sure they are re-generated as necessary. -i386-opc.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h +i386-dis.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS) $(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS) --- a/opcodes/i386-opc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Intel 80386 opcode table - Copyright (C) 2007-2022 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - It is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "libiberty.h" -#include "i386-opc.h" - -/* To be indexed by segment register number. */ -const unsigned char i386_seg_prefixes[] = { - ES_PREFIX_OPCODE, - CS_PREFIX_OPCODE, - SS_PREFIX_OPCODE, - DS_PREFIX_OPCODE, - FS_PREFIX_OPCODE, - GS_PREFIX_OPCODE -}; --- a/opcodes/i386-opc.h +++ b/opcodes/i386-opc.h @@ -1003,5 +1003,3 @@ typedef struct #define Dw2Inval (-1) } reg_entry; - -extern const unsigned char i386_seg_prefixes[6];