From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by sourceware.org (Postfix) with ESMTPS id F14123857C48 for ; Wed, 2 Sep 2020 11:57:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F14123857C48 Received: by mail-io1-xd42.google.com with SMTP id m23so5435121iol.8 for ; Wed, 02 Sep 2020 04:57:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SJ7jQvApp2OjoIHeEbgsj+MQiS/xDGQF5FaQ23cuoCU=; b=A0Xwi84mdnVBc7Z63kfN9ECmLoKmsmvlHCvnjZU049HbrVM4Y1F3koeWZvw3AIGvrr tzoVRe71mEKU/qpnqkQBQ2hU9QKRCcQ0a+he2eeOwhQm59zRaOB4c8Bssaa72J1mmTEz JZCWMBUFtoy6k6ntyV26Dk9YYCsVq0dMxHK6i4s9Rhq+D6RQtD065qb3pZka9UX0yPqS 7/b04JxL6IOhbltfCxdzWjgMOVfvzgzsw8MhsWkesaHrty1mf7bYpYDLyTBkkIBstUx4 9uW16avF4yW49OV5Ri5ayIh57rlNIvQlDFRGtlSPEfc7i+Gwp2d3YrLp/Zhs6APBxhsY oBWg== X-Gm-Message-State: AOAM533KefnXK4rBJ3GE//xXl6RvYmX0fvwNbFj7Xrj9myy6fK7vXWJl m/EIxpq9rkie1gClpXvUMPoFH04zf7hg6eBr52Q= X-Google-Smtp-Source: ABdhPJzSyxZB5uu83thf1I8wU+Rlha6LMbyXvb7jJlot5g4cfOBPpuLUjM5aOdwoKlGTmzNB655lFO1hzZrGzRVcEO4= X-Received: by 2002:a05:6638:1643:: with SMTP id a3mr2902257jat.4.1599047844475; Wed, 02 Sep 2020 04:57:24 -0700 (PDT) MIME-Version: 1.0 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> <20200902081225.GH15695@bubble.grove.modra.org> In-Reply-To: <20200902081225.GH15695@bubble.grove.modra.org> From: "H.J. Lu" Date: Wed, 2 Sep 2020 04:56:48 -0700 Message-ID: Subject: Re: [PATCH] elf: Don't load archive element after dynamic definition To: Alan Modra Cc: =?UTF-8?Q?Martin_Li=C5=A1ka?= , Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.0 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 11:57:26 -0000 On Wed, Sep 2, 2020 at 1:12 AM Alan Modra wrote: > > On Wed, Sep 02, 2020 at 08:52:06AM +0200, Martin Li=C5=A1ka 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 =3D 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) !=3D 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 =3D FALSE; > > - /* Nor should we make plugin symbols dynamic. */ > - if ((abfd->flags & BFD_PLUGIN) !=3D 0) > - dynsym =3D FALSE; > - > if (definition) > { > h->target_internal =3D isym->st_target_internal; > @@ -5192,7 +5184,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_= link_info *info) > } > } > > - if (dynsym && h->dynindx =3D=3D -1) > + if (dynsym && (abfd->flags & BFD_PLUGIN) =3D=3D 0 && h->dynindx= =3D=3D -1) > { > if (! bfd_elf_link_record_dynamic_symbol (info, h)) > goto error_free_vers; Will it add a shared library to DT_NEEDED even if the IR symbol reference i= s removed by LTO? --=20 H.J.