From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 034CB1F5AE for ; Tue, 27 Apr 2021 06:58:23 +0000 (UTC) Received: from localhost ([::1]:39986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbHfp-0004ak-Td for normalperson@yhbt.net; Tue, 27 Apr 2021 02:58:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbHfm-0004ac-Me for bug-gnulib@gnu.org; Tue, 27 Apr 2021 02:58:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbHfj-0005f7-I6 for bug-gnulib@gnu.org; Tue, 27 Apr 2021 02:58:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619506694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ukuSxr1a4foWnnQJyTmlw4ptMGCPMTkTDKcAWr2yuaE=; b=X8rBGMaEff21a/i1E7rcRdvlVNOz+YenVhEHMObjtrvsP+HoWlIovtWqHH1HOHYFI655qt +ivYIpc0y+ewjOT5hUNH7aPtJZbVacE4BXCd47qwxn+VXDeU+IwHm3sQPB9oNRLLZNoFjj IctksDRT6N/ZPG1diFFFO/euobyyABo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-524-TxwNa1zjPyqP2FR-eNBmZA-1; Tue, 27 Apr 2021 02:58:12 -0400 X-MC-Unique: TxwNa1zjPyqP2FR-eNBmZA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E3DE91275; Tue, 27 Apr 2021 06:58:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-20.ams2.redhat.com [10.36.113.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C06511001901; Tue, 27 Apr 2021 06:58:09 +0000 (UTC) From: Florian Weimer To: Paul Eggert Subject: Re: Undefined use of weak symbols in gnulib References: <87o8e0p92r.fsf@oldenburg.str.redhat.com> Date: Tue, 27 Apr 2021 08:58:36 +0200 In-Reply-To: (Paul Eggert's message of "Mon, 26 Apr 2021 23:50:26 -0700") Message-ID: <87czugp61v.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=fweimer@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Received-SPF: pass client-ip=170.10.133.124; envelope-from=fweimer@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.219, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org, libc-alpha@sourceware.org, binutils@sourceware.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" * Paul Eggert: > On 4/26/21 10:53 PM, Florian Weimer via Libc-alpha wrote: >> This will become an urgent issue with glibc 2.34, which defines >> pthread_mutexattr_gettype unconditionally. Certain gnulib modules will >> stop working until the binaries are relinked. > > Thanks for mentioning this. But in what sense will the modules stop > working? I'm a little lost. > > glibc 2.34 also defines pthread_once unconditionally, right? So why > doesn't code like this: > > if (pthread_mutexattr_gettype != NULL) > pthread_once (control, callback); > > continue to work in 2.34? The link editor does not emitted a relocation referencing the pthread_once symbol. The function address in the GOT is always zero. It does not matter if a pthread_once symbol exists at run time because their is no reference to it. Relinking the executable will of course fix this and generate a reference to the pthread_once symbol, but relinking is required. For example, bison 3.7.4 built against glibc 2.33 has these pthread* symbol references in its dynamic symbol table on powerpc64le-linux-gnu: 58: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF pthread_mutex_init@GLIBC_2.17 (2) 117: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF pthread_mutex_lock@GLIBC_2.17 (2) 118: 0000000000000000 0 NOTYPE WEAK DEFAULT UNDEF pthread_mutexattr_gettype 120: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF pthread_mutex_unlock@GLIBC_2.17 (2) pthread_once is just not there. Thanks, Florian