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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E671F1F5AE for ; Tue, 27 Apr 2021 06:58:20 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CCE25383301B; Tue, 27 Apr 2021 06:58:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCE25383301B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619506699; bh=ukuSxr1a4foWnnQJyTmlw4ptMGCPMTkTDKcAWr2yuaE=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=P6ytaM+0724s/nLXkjZaRy7p1yyPyEMqx5JnDb0LaZgq17y7WtvKrR/IjXWOGrSEi y5Pzk0MnQPQLwyBHF8UPqCz0rPAolGzPSTSVm2uLRa887QrbYNPlXraoTvTVnBpm9c 0FoADKoJ65Uh0ysvPcb90g5Ltz9rVZuswG2rKQaQ= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 62B67383301B for ; Tue, 27 Apr 2021 06:58:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 62B67383301B 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) 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: bug-gnulib@gnu.org, libc-alpha@sourceware.org, binutils@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * 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