From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 4A26E3857C4C for ; Mon, 14 Feb 2022 02:47:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A26E3857C4C Received: by mail-pj1-x1035.google.com with SMTP id v4so13223473pjh.2 for ; Sun, 13 Feb 2022 18:47:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Da6VljMkQewSBXs4d7WruREnowi+Q0KJhEeOiRUTMq0=; b=pJHUgrO4pIILJt/cFxferDaJn7ByJDMyLLNOjPlFJ3xNho3y3GH/D+Bk4oUx0MT9mr RAsutgx0xiPff8EgSpXjoOC8OQmGmqp3G9DxTXt7gec3t4SR3n4rHRUnm/eyjvFGm+kG jdt5cG3xhNk//m3rfis8fTbxl9OB/g0rOgrFBwCkOAMJ3rSHHAfXK54KWeWgSH9DeZlP NRP3/LBt9c8i+ZgqK/MpSTzvQxMKSbFQsse0qNB1TZOnzrCbz/rPJZq0gPRRyvpms+5X pUYWEsJUmQ/lQJkeTafOo0+hBh1b7/lI1hQT2tb8eAkM4p0wVUX35r9rknHvxskVa/ri DnRA== X-Gm-Message-State: AOAM53258QcjzBO2KklYETpiMw+cKwotebnyMEGxQxfZIqYztN4cUl+J p4gx9p2ssHJdDIOOefRd9UTdZRfl8jM= X-Google-Smtp-Source: ABdhPJzkzMktEY6lEyJ56SUFjovAxOPInTN6kJWerM8eTANDucuOCS/QF9EjkGqyqO8lfNGgFUfVFg== X-Received: by 2002:a17:902:e88b:: with SMTP id w11mr12193619plg.122.1644806852493; Sun, 13 Feb 2022 18:47:32 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:4cd3:5a51:b00e:3076]) by smtp.gmail.com with ESMTPSA id 1sm11711020pji.40.2022.02.13.18.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 18:47:31 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 127DA1140133; Mon, 14 Feb 2022 13:17:29 +1030 (ACDT) Date: Mon, 14 Feb 2022 13:17:29 +1030 From: Alan Modra To: "H.J. Lu" Cc: Binutils , Nick Clifton Subject: Re: [PATCH] ld: Keep indirect symbol from IR if referenced from shared object Message-ID: References: <20220211231927.2021394-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3037.1 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 14 Feb 2022 02:47:35 -0000 On Sun, Feb 13, 2022 at 04:16:35PM -0800, H.J. Lu wrote: > On Fri, Feb 11, 2022 at 3:19 PM H.J. Lu wrote: > > > > Don't change indirect symbol defined in IR to undefined if it is > > referenced from shared object. The description above > > diff --git a/bfd/elflink.c b/bfd/elflink.c > > index 6fa18d92007..f8521426cad 100644 > > --- a/bfd/elflink.c > > +++ b/bfd/elflink.c > > @@ -1294,9 +1294,8 @@ _bfd_elf_merge_symbol (bfd *abfd, > > h->root.non_ir_ref_dynamic = true; > > hi->root.non_ir_ref_dynamic = true; > > } > > - > > - if ((oldbfd->flags & BFD_PLUGIN) != 0 > > - && hi->root.type == bfd_link_hash_indirect) > > + else if ((oldbfd->flags & BFD_PLUGIN) != 0 > > + && hi->root.type == bfd_link_hash_indirect) > > { > > /* Change indirect symbol from IR to undefined. */ > > hi->root.type = bfd_link_hash_undefined; and the patch do not exactly match. The code logic is old sym indirect in IR, new sym not IR, both in shared library *or both not*. Is that correct? -- Alan Modra Australia Development Lab, IBM