From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 6B1223857815 for ; Mon, 31 Jan 2022 18:20:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B1223857815 Received: by mail-pj1-x102a.google.com with SMTP id l24-20020a17090aec1800b001b55738f633so114400pjy.1 for ; Mon, 31 Jan 2022 10:20:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tbC1Jc/oxqjP15RtBqP7f/rjmv1Sx6t1P6iyD7uU1D4=; b=zxF3PClf9RsRIyRu6h/Lqutif6untQRj5TQfohJgfzNmnLIIhWJ+R4fl80MwK1ldbc kTJK/x0reUeZjzFiSdpPt8i6v/nf5jjtIVOmVaPJuEy2oT/Yg+n4ANQ7zJPOZ72XMTwJ 473wyaquscXlSfRl3SR44cKDWe4YywQKl1oOXCY05m1yDxmimm+E9OC+CwG9ARU643G0 W4AXAr6p6aK8n9ebOiS7bvkbl6gwntj+1xNhLlMx79huDjBlWonynRGTTJslT81Vf7qw Lg9jdoLRIt/QwYVcevoyyI/tjduge1Sau2TqP83sEManD/Vma5l1tv72zmSWrrf4YOTq CdhA== X-Gm-Message-State: AOAM5309+WfDVjooQ+/MZb9WKdo8AdfX824/IQaJFJCOVWGiTH8xuSrm F8ffoKzxapnVrd0CJPi0NqDYgaozrN7wZF1Fr2I= X-Google-Smtp-Source: ABdhPJznDTgwSJmB6vTmsE9upk85MjScuAyoiT0aaCKAvZM0s94Sb6vpdjXmlSnjzOZQE3ppG3Y/VRQBG6A2U4AAKnA= X-Received: by 2002:a17:90a:1950:: with SMTP id 16mr36106820pjh.28.1643653233651; Mon, 31 Jan 2022 10:20:33 -0800 (PST) MIME-Version: 1.0 References: <20220126001953.652545-1-hjl.tools@gmail.com> <87k0ef7sxu.fsf@oldenburg.str.redhat.com> In-Reply-To: <87k0ef7sxu.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 31 Jan 2022 10:19:57 -0800 Message-ID: Subject: Re: [PATCH] elf: Don't set VER_FLG_WEAK To: Florian Weimer Cc: Alan Modra , Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3021.6 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, 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, 31 Jan 2022 18:20:36 -0000 On Mon, Jan 31, 2022 at 8:48 AM Florian Weimer wrote: > > * H. J. Lu: > > > On Tue, Jan 25, 2022 at 7:07 PM Alan Modra wrote: > >> > >> On Tue, Jan 25, 2022 at 04:19:53PM -0800, H.J. Lu via Binutils wrote: > >> > On Solaris, VER_FLG_WEAK indicates a weak version definition with no > >> > symbols associated with it. It is used to verify the existence of a > >> > particular implementation without any symbol references to the weak > >> > version. Don't set VER_FLG_WEAK since it is unused in binutils. > >> > >> Can you tell me why the presence of this flag is bad? I don't see it > >> affecting anything in binutils or glibc. VER_FLG_WEAK in version refs > >> does affect resolution of symbol, but I can't see how a VER_FLG_WEAK > >> in a version def can transfer over to a ref if the def is unused. > > > > Florian, can you share the reason why Linux doesn't want > > VER_FLG_WEAK on the empty version? > > I may have been overly cautious, influenced by the old link editor > behavior which copied the weak flag of dynamic symbols from the > definitions to their references. But it's indeed unclear how this could > happen here. If it did, we would lose the coverage check in the glibc > dynamic loader for that symbol version, I think. (The loader only > checks vna_flags in two places, once for printing the flag, and once to > skip an error report in case of a missing version.) > > Do you suggest we should start using weak symbol version definitions in > glibc, and not worry about it? Let's use the symbol versions without any symbols in glibc after glibc 2.35 is released. It will create symbol versions with VER_FLG_WEAK. If it will cause any issues, we can change linker to remove VER_FLG_WEAK from empty symbol versions. > Thanks, > Florian > -- H.J.