From patchwork Thu Dec 12 05:34:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 102834 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B4D53858C5F for ; Thu, 12 Dec 2024 05:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B4D53858C5F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YWZ4qBJI X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id CD65F3858C39 for ; Thu, 12 Dec 2024 05:34:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD65F3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CD65F3858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::634 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733981655; cv=none; b=WA7TZbQcqOLRqdHqFZR2UHHVVXAF62nyAdWujCHd5LnmG3ZqweoMxxOyFmo1vAxkXO0vvrSxkbyABqC1D6QmYe4CZOD2ZcCwMbOVMh8F9PSuTHQORGKPmYzGUJImE2BBMHwb30VtBrnOrKq+MAZmDFok0w/352/t5wzmB3PPbUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733981655; c=relaxed/simple; bh=gLqAwHMl+ihpBy04oiG7pJPditWkSTAFeD6dukQvzSk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=dL8YbVaFHYX+pijAku4AXKsn1IIyxMABp2009gUnwwRj4qpgZzUiMk5Xnj8q5NmtshSoLDaBB7wqqcV+uV+3HN6OH0ihjg/0FEiYUKPZWPmAocv+rHrhGl9OBH8m/Xu9U67Sqg0ega+vpOT3qHcCqqKrrl8C8ujVUEXVaRqvmBg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD65F3858C39 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21675fd60feso2227915ad.2 for ; Wed, 11 Dec 2024 21:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733981649; x=1734586449; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Uxefs9dMqxmjqjCetzhcgHzkIFnor02fE+wZMdNTCiI=; b=YWZ4qBJImK1IHZh4OV7HADMqgLdcvruHOE6MlPtRM32sCaxXgSIpX3rh/Wj63BcgTx XcDhD6ZVe6iT94yKZe5RS60bq9QbR913rE8rj/GjDClDEEXj0pY9bH1D94hq+EwSV+mp Kyo+eq8s9YCn0a335DMga7/FZnQhg2Imr2CuFSQJVIIVRCeSI9bpGUt8aZ/BGgPAS6uD AqaqSFa70ZfOPHsxZy6vYyH/cTio6V09jVVqu4NycQD8XpbY+ITQJVCWmWm0S5VrUas+ EumzMJqa2kc9xqZfzw3vJ9t/OuxIog/mjpzJhbi/J0e2Y5n5I4zssLjd089wTCSjSbyR f2MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733981649; x=1734586449; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uxefs9dMqxmjqjCetzhcgHzkIFnor02fE+wZMdNTCiI=; b=Mvx3FmVWKy2RGy+hB3LfDQl9F0EK1VwiQz1Cn4Su0UHo+RfCSgiLgDdp7jZN4A921Y ujeZuHpG05DgM1h0tWqSVZ+MHzKY96RwnVJByusRbxUy0mVhXS/k361nvaFJpSz26vQt esxcNJY9QGITb06Z/Y1FPaR581qc1zpcwarKKrDaK2jI/NFZL1AuKU2fr4qTdu3jbzpf AEbUVbbGMcQzjy+jOPIbqKpRm+TajbxwK8ixzmiDWNSkma9xg/T6WmxmqUW+OwC9WAW8 yuTGW9f5ljg2O2GfyIxAatCH6YWaUMVqL1SF0jqvUkmRkeyc2TisQV0yVhZb0IyDB+HD LNwQ== X-Gm-Message-State: AOJu0YzoTSUtYHTLddvhWteJb97yCQIsq1A69lUkvrbNVOKENmz4tUB1 L+cvlvvfEinrRanhy6OGETSlGnKo1wJz09PziL1Zu002pqTk7NHj1FvtmQ== X-Gm-Gg: ASbGncuAUqAtGam1gRlnpD8uzoqByWOVbYOFUQpPWdrjuX+NLpIqn/yVCVsKZDAr5SR lbjo9hkCgtE5TL7Ko3vLT6Y4v2rTfeF14FDVmfdzhYWU+/Cvt1LPitMP4Lue7wBwTYH+awIMiik 9aNvxh3pO8FxLVTSfofebdfFg5fP7w+JBNmUR1b90jOfl80IaD3C8Ln5iksOyNeUh1nB1j8fb7o ZP8pXSH0I6mS6YXrRc41X8zxTqTE7MqKFF1PQjI9Nj3qm281pNrhLm0HsFE8nbDcxwjLuN1dhdO ro35Bs0o1UjiKntgsq/nESmN+hs= X-Google-Smtp-Source: AGHT+IHmdhvxUpxgdzfDKy58M4bnvZoNB0UiuyKlfMYTI7aGggBjVPNTx3/IOPXIgG2V6nIHzsM9RQ== X-Received: by 2002:a17:903:22c8:b0:215:b5d6:5fa0 with SMTP id d9443c01a7336-2178aeefc39mr46009445ad.36.1733981648676; Wed, 11 Dec 2024 21:34:08 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2162e22d4besm81248475ad.230.2024.12.11.21.34.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 21:34:08 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 014AA11424B1; Thu, 12 Dec 2024 16:04:06 +1030 (ACDT) Date: Thu, 12 Dec 2024 16:04:05 +1030 From: Alan Modra To: binutils@sourceware.org Subject: Revert bfd_use_reserved_id patch Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3032.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Commit fc1cfaa5f1 and bc110b6e40 were made to avoid testsuite regressions on a number of targets that used bfd id in symbol hashing. Since it no longer seems necessary to start plugin bfd id's from -1 and count down, revert the functional changes in those patches. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 092a6587c1c..8cc255b8354 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3007,9 +3007,6 @@ bool bfd_merge_private_bfd_data (ibfd, info)) /* Extracted from opncls.c. */ -/* Set to N to open the next N BFDs using an alternate id space. */ -extern unsigned int bfd_use_reserved_id; - bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); diff --git a/bfd/opncls.c b/bfd/opncls.c index bc76696dfdb..dd0afaae85d 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -45,18 +45,9 @@ SUBSECTION Functions for opening and closing */ -/* Counters used to initialize the bfd identifier. */ +/* Counter used to initialize the unique bfd identifier. */ static unsigned int bfd_id_counter = 0; -static unsigned int bfd_reserved_id_counter = 0; - -/* -EXTERNAL -.{* Set to N to open the next N BFDs using an alternate id space. *} -.extern unsigned int bfd_use_reserved_id; -. -*/ -unsigned int bfd_use_reserved_id = 0; /* fdopen is a loser -- we should use stdio exclusively. Unfortunately if we do that we can't use fcntl. */ @@ -83,13 +74,7 @@ _bfd_new_bfd (void) if (!bfd_lock ()) return NULL; - if (bfd_use_reserved_id) - { - nbfd->id = --bfd_reserved_id_counter; - --bfd_use_reserved_id; - } - else - nbfd->id = bfd_id_counter++; + nbfd->id = bfd_id_counter++; if (!bfd_unlock ()) { free (nbfd); diff --git a/ld/plugin.c b/ld/plugin.c index 2cd0279c93a..2c3fcb7ad62 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -318,7 +318,6 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate) bfd *abfd; bool bfd_plugin_target; - bfd_use_reserved_id = 1; bfd_plugin_target = bfd_plugin_target_p (srctemplate->xvec); abfd = bfd_create (concat (name, IRONLY_SUFFIX, (const char *) NULL), bfd_plugin_target ? link_info.output_bfd : srctemplate);