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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, 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 (server1.sourceware.org [209.132.180.131]) (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 7835F1F461 for ; Tue, 3 Sep 2019 13:25:41 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=cOdtZJfk84XjyyG4 96+Cl6quIVophGwKNyw7PD0NrF8euixN4hWtkbwR4rm07HbLb0AuvqyNv2FbmtoM 88a9+vZV6/NqZeCe2kCAYXrzd0s3XUvGAstE2J/+gr8s9QMxA2yv+xDdAWd22018 9jCLXbWKFSRnDdjNj/nu7S8Kek4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=tFMU7ylUttJM1Wgm5Wm7x+ FClqY=; b=i+d0e7N8CsLg1X6wtNr8mypd5swRPNcrEYVn+WIL/dmkj9g4n56VDa ndC21UIkXLIU0X6KSrrAyx6eTEFlbNoh03Hsa+DMAnKEwTE9FX8ZSpcUxCgsQhJz mkOnea8X5/5NBeWuvRdmGmDaBLiSLnv1v/eE0g2J4lK/yjuK4CEr8= Received: (qmail 110515 invoked by alias); 3 Sep 2019 13:25:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 110483 invoked by uid 89); 3 Sep 2019 13:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qk1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:openpgp:autocrypt:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y+P2//FBAxZ0Lv2cnP+LpTyLIhUPuG4R0P79GJ+UbqE=; b=RXVJXV/h6m61sspXOITNqcHoGHNoTLztzU6aiOEOIdSmtqOGuduTAYzlw+aTY0VGwn Rc0qH3zAK0tGd0ywqGboaIDi4kZPfvTqVhSrmueM+yhJh8MZpBP7pxPAC8My9T8LsL5S qTnZvW+linQXi3CRxRhGjT2cTRI6V0jLehy9wmB121lz9+/IduJprjkv0zmlAJ26ON83 hEeYsSc+g/FBDthwOqEGmdlfQHajrhEj4Mk8d40uZZtUcY0FyVuYBq8TClXz+FD0Tuyw UcDWB+UQDsAb8I3BZ73Yyv5H0ZaUmN+RZLT0yNFrwWqvuC7+je61hiPSErW91nj8r0XD M8Fg== To: Florian Weimer , Zack Weinberg Cc: libc-alpha@sourceware.org, Joseph Myers , Lukasz Majewski , Alistair Francis , Stepan Golosunov , Arnd Bergmann , Samuel Thibault References: <20190828153236.18229-1-zackw@panix.com> <20190828153236.18229-3-zackw@panix.com> <87h85tu9bp.fsf@oldenburg2.str.redhat.com> From: Adhemerval Zanella Openpgp: preference=signencrypt Subject: Re: [PATCH v2 02/10] Finish move of clock_* functions to libc. Message-ID: <2bd7b653-e698-73c7-72b0-4e90c4b08d7a@linaro.org> Date: Tue, 3 Sep 2019 10:25:28 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87h85tu9bp.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 03/09/2019 04:29, Florian Weimer wrote: > * Zack Weinberg: > >> diff --git a/rt/Versions b/rt/Versions >> index 91e3fd2a20..84d1345420 100644 >> --- a/rt/Versions >> +++ b/rt/Versions >> @@ -1,15 +1,3 @@ >> -libc { >> - GLIBC_2.17 { >> - # c* >> - clock_getres; clock_gettime; clock_settime; clock_getcpuclockid; >> - clock_nanosleep; >> - } >> - GLIBC_PRIVATE { >> - __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid; >> - __clock_nanosleep; >> - } >> -} > > Sorry, you cannot remove the GLIBC_2.17 symbol version in this way, > otherwise old binaries will fail to load. You need to leave behind a > dummy function definition. See __libpthread_version_placeholder for how > I handled this in the libpthread/vfork case. Are you sure about it? on x86_64 I am trying to force this issue: -- $ cat test.c include #define symbol_version_reference(real, name, version) \ __asm__ (".symver " #real "," #name "@" #version) symbol_version_reference (clock_gettime, clock_gettime, GLIBC_2.2.5); int main () { struct timespec ts; clock_gettime (CLOCK_REALTIME, &ts); return ts.tv_sec; } $ gcc -Wall test.c -o test -lrt # Check if this indeed links against old librt version $ readelf -s test | grep clock_gettime 5: 0000000000000000 0 FUNC GLOBAL DEFAULT UND clock_gettime@GLIBC_2.2.5 (4) 56: 0000000000000000 0 FUNC GLOBAL DEFAULT UND clock_gettime@@GLIBC_2.2. # Check if master branch does not fail to load the binary $ ./x86_64-linux-gnu-master/testrun.sh ./test # Chec # librt.so does not have the clock_gettime symbols $ readelf -s x86_64-linux-gnu-patched/rt/librt.so | grep clock_gettime@ 37: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __clock_gettime@GLIBC_PRIVATE (7) 232: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __clock_gettime@@GLIBC_PR # There are now provided solely by libc.so $ readelf -s x86_64-linux-gnu-patched/libc.so | grep clock_gettime@ 837: 00000000000c0be0 109 FUNC GLOBAL DEFAULT 12 __clock_gettime@@GLIBC_PRIVATE 1744: 00000000000c0be0 109 FUNC GLOBAL DEFAULT 12 clock_gettime@GLIBC_2.2.5 1747: 00000000000c0be0 109 FUNC GLOBAL DEFAULT 12 clock_gettime@@GLIBC_2.17 7580: 00000000000c0be0 109 FUNC GLOBAL DEFAULT 12 clock_gettime@GLIBC_2.2.5 8291: 00000000000c0be0 109 FUNC GLOBAL DEFAULT 12 clock_gettime@@GLIBC_2.17 # And it does not fail $ ./x86_64-linux-gnu-patched/testrun.sh ./test -- LD_DEBUG=all indeed shows us the symbol resolution is done as expected: 9832: symbol=clock_gettime; lookup in file=./test [0] 9832: symbol=clock_gettime; lookup in file=./x86_64-linux-gnu-patched/rt/librt.so.1 [0] 9832: symbol=clock_gettime; lookup in file=./x86_64-linux-gnu-patched/libc.so.6 [0] 9832: binding file ./test [0] to ./x86_64-linux-gnu-patched/libc.so.6 [0]: normal symbol `clock_gettime' [GLIBC_2.2.5] 9832: Do you know how exactly this issue might happen? > > I think we need to bring back the file version information in the ABI > lists because it is part of the ABI, after all. > > We have received a bug report that the librt IFUNC resolvers actually > cause programs not to start: > > > > I would appreciate if you could mention this bug number in your fix. Yeah, we need to remove these ifunc redirection hacks. > > Thanks, > Florian >