From patchwork Mon Sep 9 00:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 97318 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 3B399385B50D for ; Mon, 9 Sep 2024 00:27:32 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 34D703858C66 for ; Mon, 9 Sep 2024 00:27:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34D703858C66 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 34D703858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725841627; cv=none; b=rZwKZ2KDhGsb1gq5coVwbGh+8IHhMmhX78qT6v4+XUrum1i84SwR44VGISiSFniiDVzf0ECT2d4p0jmM2jl7VttE0ZxNHVh6DlZsTaQOhCNgWsQ3UNE8yM+AejdbNKySbS6kI9VfzvzpFKvuOAcUVQQC5mxR8aSQtx0Quirk5ZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725841627; c=relaxed/simple; bh=57/eDF0oT0SaTTZOZ4c0d6p+1Rdxrlv88mYY8zMxQ3k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LD9IioFLGY34lCeI28Oms95p1I5RahEkc7PRg77EN+C5KcCoreu53/Mg70E+46ZCtkLZXW+TraJ+5el7e6lBi8dgrkIVtA0JV8ZBDs9DEgPVItvbiNKq1T9EJ8L1b3gKRcu72Jzqaa+qQ9Dsre76XnCAH58IcDK8gf6dGj4oSk0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2068a7c9286so33871695ad.1 for ; Sun, 08 Sep 2024 17:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725841624; x=1726446424; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Uu3H/Fr3+vONoLQd4vdOJiOXp3hFmyc2tighxdLLuE0=; b=VdsObY/2QR5nmWH2/Ut38J7tEAK0x4jmWAUJd8z6eKwrGr21kA0Zwaz8Y1RElF9029 BDETLfl+yjmjsFO5XquFBlCpqNvcofaRbfES5HbrFnDVNzedTo33tbnm79n5pE1z/2nt GgOXjWMkcc5uGxr8dkaxVyt/j0GBb90Vb46ahdvhLntP664XmtFEYJi7mrj3ioi2yD0Y fXoIeuy6C9vI4cXfhIjt8Wrf2ach/yKQTfrCfo+JSfbqfsLulx7QU6RlNHulByveLmx6 bPQ8YYauMkfAWRoJoEavf8eTQVe9T0J8+72nSZboNcCxHjInaHvXZRmfmzAx+Lv/ZmZ8 5Inw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725841624; x=1726446424; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uu3H/Fr3+vONoLQd4vdOJiOXp3hFmyc2tighxdLLuE0=; b=p0EgutWhgWj4U3HRPGRPGSb/clW14ieVSikrl0USIiMP4k1wK1WXumQs2xAiOns/l6 RFaOw7UmXXUUcxUCxq59K9NgTKhYi0Zg+3BGbh8+rfXeLXXERy3Ai/YW9o7Nnjv+DBoX a0oZT2Cl6hr6f8groLeuI18rs1Qi4YsQVJcDwg7mICKIYXSNKxbGiDFfmZmHEhMz01/A dWe+pjE+uV0WmEEqrUJlMFaGSbsEt1oLPGxN+9Rvpo0Bb2VOQCq5euCalJAQA7RBg6Pp j3KvdZcX9AwegTyvnDHFlXSu8jNddXYC4Sdm3b+b01ra2yVh4gQNLdQbm9w8gL43nZNa q/sA== X-Gm-Message-State: AOJu0YyrNZboNjE1cHSxbnlyXTcOQFhG+6LydBC/NMFgWOxO4oaqcTUy Rgf+ZDPOU5eJUExvTzv2xMbL8gy3mmsmCQrz5mXcZRaQzlREY8S89yV7+vY/Qz4= X-Google-Smtp-Source: AGHT+IFQkukza0gr044qnEj71N2gHvfPvTm9vzm2Jelgquc8fLxEZjjii2eN6iTRubIdXFtWqVjfJQ== X-Received: by 2002:a17:902:fc4e:b0:1fd:791d:1437 with SMTP id d9443c01a7336-206f04a0360mr126287585ad.6.1725841623674; Sun, 08 Sep 2024 17:27:03 -0700 (PDT) Received: from gnu-tgl-3.localdomain (42-200-201-63.static.imsbiz.com. [42.200.201.63]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710e34f8dsm24084595ad.75.2024.09.08.17.27.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 17:27:03 -0700 (PDT) Received: from gnu-tgl-3.sapphire.lounge (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 2814DC012F for ; Sun, 8 Sep 2024 17:27:00 -0700 (PDT) From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] bfd: Pass true to ld_plugin_object_p Date: Sun, 8 Sep 2024 17:27:00 -0700 Message-ID: <20240909002700.222606-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3020.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 Since linker calls bfd_plugin_object_p, which calls ld_plugin_object_p, only for command-line input objects, pass true to ld_plugin_object_p so that the same input IR file won't be included twice if the new LTO hook, LDPT_REGISTER_CLAIM_FILE_HOOK_V2 isn't used. PR ld/32153 * plugin.c (bfd_plugin_object_p): Pass true to ld_plugin_object_p. Signed-off-by: H.J. Lu --- bfd/plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bfd/plugin.c b/bfd/plugin.c index f6c6fdbee69..de2137fddc4 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -596,8 +596,12 @@ load_plugin (bfd *abfd) static bfd_cleanup bfd_plugin_object_p (bfd *abfd) { + /* Since ld_plugin_object_p is called only for linker command-line input + objects, pass true to ld_plugin_object_p so that the same input IR + file won't be included twice if the LDPT_REGISTER_CLAIM_FILE_HOOK_V2 + isn't used. */ if (ld_plugin_object_p) - return ld_plugin_object_p (abfd, false); + return ld_plugin_object_p (abfd, true); if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd)) return NULL;