From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by sourceware.org (Postfix) with ESMTPS id A9AAE3857031 for ; Thu, 27 Aug 2020 13:53:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9AAE3857031 Received: by mail-pj1-x1043.google.com with SMTP id q93so2672583pjq.0 for ; Thu, 27 Aug 2020 06:53:17 -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:in-reply-to:user-agent; bh=ogqIdEZt//V6XuwsnhYTFvmYl7WrcIZWmS/OHTtIee4=; b=A3r/ReXAz2kykhLB/CpKQT8jm1Emd+YsYWEVzf7s31xkQoD23WY8j0zc+HmlfyJFp4 OJNdSpzSYTygLWUn0ag8l1ss2nKR52lKexGYfWQwl3wMT3eg7j0etC/Xoqr1WWlrPeBh WGHJD2IxZhaeUjqQYov9K/hQaHCJyCwfok0PbZ9k/2bWWxNxUPIQc4BNxWX2V2Q7l2J7 UotofYm5d/zrzF7GFkpUsuSub1DojaR3+N1JDWg8lVEZkR7hkK4yxK9D8tU0sdah3TSW bqqOYvBrtMuZpHnpzadCpsIkuFSD+AuyxtPJ7OR86ZRv3hqBiCI4FKXlQCz7xmk7aOM8 mVZA== X-Gm-Message-State: AOAM5326L1x70bdMFKnUG/3isw3sH1PSTyqs5FfV4fMZI1UwFMQ5LirA k8aHPuW8UF9W7Fw3wtwAfqQbrOzHSiLFXQ== X-Google-Smtp-Source: ABdhPJyD2av0anlEEocJ7pmlD6zmGUroASoe2CeMCSbKnjM4yxhmT/Aqzb1M61QHb29D3+yCOA+j4w== X-Received: by 2002:a17:90a:2bce:: with SMTP id n14mr10871929pje.20.1598536396955; Thu, 27 Aug 2020 06:53:16 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:dcb6:49b1:12d4:ba6d]) by smtp.gmail.com with ESMTPSA id s64sm3105133pfs.111.2020.08.27.06.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:53:16 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 406FF80CF7; Thu, 27 Aug 2020 23:23:12 +0930 (ACST) Date: Thu, 27 Aug 2020 23:23:12 +0930 From: Alan Modra To: "H.J. Lu" Cc: binutils@sourceware.org Subject: Re: [PATCH] elf: Don't load archive element after dynamic definition Message-ID: <20200827135311.GD15695@bubble.grove.modra.org> References: <20200825172842.1212936-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825172842.1212936-1-hjl.tools@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Thu, 27 Aug 2020 13:53:18 -0000 On Tue, Aug 25, 2020 at 10:28:42AM -0700, H.J. Lu via Binutils wrote: > Don't load the archive element after seeing a definition in a shared > object. > > bfd/ > > PR ld/26530 > * elflink.c (elf_link_add_object_symbols): Also preserve the > dynamic_def bit for --as-needed. > (elf_link_add_archive_symbols): Don't load the archive element > after seeing a definition in a shared object. This seems over complicated to me. Why don't we just load the as-needed shared library on the first pass? -- Alan Modra Australia Development Lab, IBM