From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by sourceware.org (Postfix) with ESMTPS id 5FB8D386F421 for ; Wed, 2 Sep 2020 08:12:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5FB8D386F421 Received: by mail-pg1-x544.google.com with SMTP id 31so2146549pgy.13 for ; Wed, 02 Sep 2020 01:12:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=BSZUMXMdCNRS4cMfI/KjfEPsJPnooTgq3wr32EPbmyg=; b=uD8cI+bwInUrPY6+aSHP4vDqRMvw6u5bpWP1kP5xLV3Q7TBGB2EkfG4VdcU43tfc2w YzxR/nkO1OhcZTvjU6nRUogadLgeRd3unK+JAZQx7zIkjLAtxrY43OA56kAZLHwvM5N7 qRgLaFd8i9upSBn0Gs9vX+fuAtbuWk9SF/RNOCYr2aUa/OK2oDsTOUHmtH81vgaHtSXL COAEGKG5fVF4PWls7nSJ2ENhfVN/FbZ5SL3ck+7j1ToayEfDOH424G3DDHyPTUPZe4EH BtHxXgSAcnnM1dalo0tiIbjk0mrz+TT+kGGlNYQTYDLn341CGb11pbpdihDftypZOv51 gAQQ== X-Gm-Message-State: AOAM532FMK5R4bhaNpVxSrotHid9GGyRqVDBRryrg3bRVpHxKvZag7iI ayzbH3PHFWImoV8d/aKOhXU= X-Google-Smtp-Source: ABdhPJxPwqGyLrssO38oL+aDSm2nG3084/2afQUokYaNoKQ50REg0zCj+7eHYRJ5aRzCJd26GkdK9w== X-Received: by 2002:a63:4c:: with SMTP id 73mr1107845pga.286.1599034350496; Wed, 02 Sep 2020 01:12:30 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:84c2:3a8b:c3d4:afab]) by smtp.gmail.com with ESMTPSA id f4sm4305184pgi.49.2020.09.02.01.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 01:12:29 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id B9DBE8796C; Wed, 2 Sep 2020 17:42:25 +0930 (ACST) Date: Wed, 2 Sep 2020 17:42:25 +0930 From: Alan Modra To: Martin =?utf-8?B?TGnFoWth?= Cc: "H.J. Lu" , Binutils Subject: Re: [PATCH] elf: Don't load archive element after dynamic definition Message-ID: <20200902081225.GH15695@bubble.grove.modra.org> References: <20200825172842.1212936-1-hjl.tools@gmail.com> <20200827135311.GD15695@bubble.grove.modra.org> <20200828015847.GG15695@bubble.grove.modra.org> <20200828144914.GP15695@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-10.4 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 02 Sep 2020 08:12:32 -0000 On Wed, Sep 02, 2020 at 08:52:06AM +0200, Martin Liška wrote: > On 8/28/20 4:50 PM, H.J. Lu via Binutils wrote: > > PR ld/26530 test still failed. > > Hello. > > Is there any progress on this please? I think what we want is the following, and some tweaking of the testsuite to remove FAIL: PR ld/15146 (1). That test relied on not loading a shared lib due to an IR symbol reference, but the logic added by git commit 3d5bef4c0871 has already been reverted. diff --git a/bfd/elflink.c b/bfd/elflink.c index 5c085b14b7..346f534911 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4977,11 +4977,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) object and a shared object. */ bfd_boolean dynsym = FALSE; - /* Plugin symbols aren't normal. Don't set def_regular or - ref_regular for them, or make them dynamic. */ - if ((abfd->flags & BFD_PLUGIN) != 0) - ; - else if (! dynamic) + if (! dynamic) { if (! definition) { @@ -5162,10 +5158,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) && !bfd_link_relocatable (info)) dynsym = FALSE; - /* Nor should we make plugin symbols dynamic. */ - if ((abfd->flags & BFD_PLUGIN) != 0) - dynsym = FALSE; - if (definition) { h->target_internal = isym->st_target_internal; @@ -5192,7 +5184,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } } - if (dynsym && h->dynindx == -1) + if (dynsym && (abfd->flags & BFD_PLUGIN) == 0 && h->dynindx == -1) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) goto error_free_vers; -- Alan Modra Australia Development Lab, IBM