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: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.3 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,URIBL_BLACK shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 18E901F5AE for ; Tue, 4 May 2021 12:24:46 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E94233989CB9; Tue, 4 May 2021 12:24:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E94233989CB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620131085; bh=xuy5p7AvbLF9aN9QtODliB8AXCdtBHglWIXfpjJeSwc=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=p4oQR+vzQnlJPNbk/scR5Ij4hVkli3U6Yti3oLs7EmhMwOcTylysS6RIAT/r+tRUf NP0r1zcTJb2/iKj+jKTEbr6ui1hDPXX+JSKqJ+uexH5iLu/gD2MEKq4t8nikbfLQug shgrwmpwhqcB60r4f0Fb55rKubuvwRe60pOeBdSw= Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by sourceware.org (Postfix) with ESMTPS id 470BB3984040 for ; Tue, 4 May 2021 12:24:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 470BB3984040 Received: by mail-oo1-xc2c.google.com with SMTP id i20-20020a4a8d940000b02901bc71746525so1962043ook.2 for ; Tue, 04 May 2021 05:24:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xuy5p7AvbLF9aN9QtODliB8AXCdtBHglWIXfpjJeSwc=; b=nH09BwQ3dgG02rZJivFR3jrTXAe2ZROXxjhpz7GKsLi/OCvx2JhztQy82Y5iptDpgw YEOifxpSFdJxcIdLZD3AL6/PKTsYwkRjqf9ipgVjL/uDkibPFkJ365ecTPPcGML60b2G np6nrusQN1xwIx0cwjlgnllpbwxpPmy0yxuJ1nYhbWioyRBTkCVq2ynjFxA1NZXTleuy c9Jp5KwaQ3BIIrCqR5iDr2X7k67cmuBNoRrl8YW5mAHt/vLd5hzzcNm8QVvjTWiuBwgN l9ghFQmnSt+6ZCfQOoCaUuvSW1QAW05Y7DNXRIVYJOuJfCstBSuOXb0l07Pp9ARx0+O/ XYoQ== X-Gm-Message-State: AOAM530b5AAUyxx2eGBYKNtOHd0HyzDJ1ACOz55l1Q9qzHv76viEo4Sq P8tK/QC19DpTRbNPbnj5trIl9IhEOz08oHRB3MA= X-Google-Smtp-Source: ABdhPJza3nBfjShWH3VHPJmVX2/87nacozNjgXIYP/mPOjf4N7RewISFW4+yCO4hVJW8kZVPqgS848qPtKPQzU+jtFo= X-Received: by 2002:a4a:4ac7:: with SMTP id k190mr11461271oob.9.1620131082697; Tue, 04 May 2021 05:24:42 -0700 (PDT) MIME-Version: 1.0 References: <87h7jqguew.fsf@oldenburg.str.redhat.com> <87k0oeln6s.fsf@oldenburg.str.redhat.com> In-Reply-To: <87k0oeln6s.fsf@oldenburg.str.redhat.com> Date: Tue, 4 May 2021 05:24:06 -0700 Message-ID: Subject: Re: [RFC] elf: Implement filtering of symbols historically defined in libpthread To: Florian Weimer Content-Type: text/plain; charset="UTF-8" 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: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: Andreas Schwab , GNU C Library Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Tue, May 4, 2021 at 5:04 AM Florian Weimer wrote: > > * H. J. Lu: > > > Since we want to detect the binaries which were linked against glibc > > older than 2.34, we should use the glibc version to check the old > > binaries. > > The patch attempts to detect old main programs by looking for the > GLIBC_2.34 symbol version. Since we added __libc_start_main@GLIBC_2.34 > (which is called from our version of _start), all standard main programs > linked with glibc 2.34 or later will have this symbol version. > > > Of course, we should make a complete list of functions which are > > really implemented in libpthread.so and will be moved to libc.so in > > glibc 2.34. > > I'm not sure if it is necessary to do this for *all* symbols. Formally, > a symbol added after glibc 2.0 is not suitable for detecting the > potential multi-threaded nature of a process because the application > could be built for an earlier glibc version, where the symbol is not > available, but pthread_create can still create new threads. The use of > pthread_mutexattr_gettype@@GLIBC_2.1 as the detection symbol does not > follow the rule, of course. With the explicit table approach (as in the > patch), we can add additional lookup symbols later, so I think we can > start out with the GLIBC_2.0 and GLIBC_2.1 symbols plus thrd_exit (the > latter is also used by gnulib for some reason). > Can we invent a symbol or version to detect the older binaries? If not, can GNU property, ABI note, .... help here? -- H.J.