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, NICE_REPLY_A,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=unavailable 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 2881F1F5AE for ; Wed, 28 Apr 2021 14:52:12 +0000 (UTC) Received: from localhost ([::1]:59364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lblXv-00034a-2E for normalperson@yhbt.net; Wed, 28 Apr 2021 10:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lblXr-000343-NL for bug-gnulib@gnu.org; Wed, 28 Apr 2021 10:52:07 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.54]:30480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lblXp-0007ce-NZ for bug-gnulib@gnu.org; Wed, 28 Apr 2021 10:52:07 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1619621302; cv=none; d=strato.com; s=strato-dkim-0002; b=SLYCwHbgONFwPNFcUDtEsN5ntuykOu8rWDVT97LuVzFxzXnPFgcryi+KHydKYjHOka CFvpCA/7btgoMgvZwioQqFzv+gBlTGnEHI3RYlSPolF6wVZlgLOvqSFSN4Fy8l2j2ulD +BAvVAdnBGwfOn/ba9iIVJ3Yrr9TLT0Wjq/Hh6Jq6e/wN4X7vZvN/Dx2UqGObkGzabLj b609objV4bxa0O7egPPzX5k1CDnyr/0yG46Gm1abQ2wTAw0tEIizlJ5q3IeqE5JbZmj/ ilLpLk9Vc2cUVDOsmEvHJwEesnZghLK+1nCMJ2VObY3gVagn7kzJRDm6cuSBhgaZ3DIR TxMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1619621302; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=rsvty3vTWFDov0s0FeTbIdVgXw+aNqf/4l25/B+Yzfw=; b=I9jHrA1uBGaK8b5URXeW/q9UUsJhEX221NVVwIjXGG3SjftUCKRflAqYr/pfGBt3AM Gd4wHZ1wUG5/zWuu5O7RkwUrMEK5FfmwRYyFg51UU7lRf9nN4noawzcKy3Ir0nC63zgA 7NKLlco2/9D//wZJVPN8o9Yd5/VnesmT0x/b+KEIm8CAsBKeWCKCOl4F/EOnB84xk35n TX125or1JMzOwzQ9uMuHt4iwRiPdEOfnqnrQzzaBWqDmPhYwKzJFcOvTlpbkdHUHHTJB NeMCfyXOafbLMMu+OwSlrhXt5JS7Ct1K0QO3TdX5elXV+MICJNHucyArOVZAiH+ZrPgM sMQg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1619621302; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=rsvty3vTWFDov0s0FeTbIdVgXw+aNqf/4l25/B+Yzfw=; b=X/Ebl2fyWXsN6/O93cAsBRWQdZNumbzCOPkq+JncIvcXg0zJH+Wpb8/Zsb6huZAtfa EGusYthyQ4mLF5HCotdtJ0bXkWQtz0TtNdCNeWsCYcWwTK/+8k84/ModYEFVG/I4zgLG VaTQoTk2/bqEgOSo2ZiMDy2m3zEFyxfqyMrdcs9nf6OqbyHE+FtdGrvp0hokLaYVJQOv RCQXLqV3jKS29gy668vni76Gy8RZGbS6eKq9f4tTQOs8GQrx4kCCibMtWyrvYb/Whe8+ Q4Utm1CPuxAxtJJe8rKd4qfvnik9hT3JyHABrbQmQbCLqGCJOFCJSx1SWoUeZ+asFIcq 21nw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqf3z5NW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.25.2 DYNA|AUTH) with ESMTPSA id 905ad3x3SEmL8ND (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Wed, 28 Apr 2021 16:48:21 +0200 (CEST) From: Bruno Haible To: Florian Weimer Subject: Re: Undefined use of weak symbols in gnulib Date: Wed, 28 Apr 2021 16:48:20 +0200 Message-ID: <3309003.lbPZiPdySv@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <87a6piluow.fsf@oldenburg.str.redhat.com> References: <87o8e0p92r.fsf@oldenburg.str.redhat.com> <1680226.UWtE2gOZdF@omega> <87a6piluow.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.54; envelope-from=bruno@clisp.org; helo=mo4-p01-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=unavailable 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: Andreas Schwab , libc-alpha@sourceware.org, bug-gnulib@gnu.org, binutils@sourceware.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Florian Weimer wrote: > > $ gcc -Wall -fpie -pie foo.c ; ./a.out > > initialization code > > > > $ gcc -Wall -fpie -pie foo.c -Wl,--no-as-needed -lpthread ; ./a.out > > multi-threaded initialization > > initialization code > > > > What will change for this program with glibc 2.34? > > If recompiled in this way: The presence of -lpthread will not matter, it > will always behave is if linked with -lpthread. So it will print multi-threaded initialization initialization code in all cases. This is perfectly fine. > The relevant scenario here is LD_PRELOAD of a library that depends on > libpthread.so.0 ... > If not recompiled and linked without -lpthread against glibc 2.33 or > earlier, the behavior with the current glibc 2.34 snapshot is > architecture-dependent and also depends on the binutils version used for > linking the program. In some cases, calling pthread_once jumps to > address zero (causing a crash), or the call to pthread_once is elided > from the executable. This scenario can be emulated with older glibc > using LD_PRELOAD=libpthread.so.0. I'm confused again. Are you saying that the crash will occur when old binaries are being used with glibc 2.34 also *without* LD_PRELOAD? Bruno