From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18894 invoked by alias); 18 Jun 2018 11:52:36 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 18765 invoked by uid 89); 18 Jun 2018 11:52:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ended, Rename, 1810 X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Jun 2018 11:52:33 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABD845D5E8 for ; Mon, 18 Jun 2018 11:52:32 +0000 (UTC) Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 792C91916D for ; Mon, 18 Jun 2018 11:52:32 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id D873040296333; Mon, 18 Jun 2018 13:52:31 +0200 (CEST) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.27 COMMITTED] x86: Make strncmp usable from rtld User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20180618115231.D873040296333@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Jun 2018 11:52:32 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00002.txt.bz2 Due to the way the conditions were written, the rtld build of strncmp ended up with no definition of the strncmp symbol at all: The implementations were renamed for use within an IFUNC resolver, but the IFUNC resolver itself was missing (because rtld does not use IFUNCs). Reviewed-by: Carlos O'Donell (cherry picked from commit e826574c985a15a500262f2fbd21c7e9259d3d11) 2018-06-12 Florian Weimer x86: Make strncmp usable from rtld. * sysdeps/i386/i686/multiarch/strncmp-c.c: Only rename strncmp to __strncmp_ia32 if in libc (and not in rtld). * sysdeps/x86_64/multiarch/strncmp-sse2.S: Rename strcmp to strncmp if not in libc (and not to __strncmp_sse2). diff --git a/sysdeps/i386/i686/multiarch/strncmp-c.c b/sysdeps/i386/i686/multiarch/strncmp-c.c index cc059da494..2e3eca9b2b 100644 --- a/sysdeps/i386/i686/multiarch/strncmp-c.c +++ b/sysdeps/i386/i686/multiarch/strncmp-c.c @@ -1,4 +1,4 @@ -#ifdef SHARED +#if defined (SHARED) && IS_IN (libc) # define STRNCMP __strncmp_ia32 # undef libc_hidden_builtin_def # define libc_hidden_builtin_def(name) \ diff --git a/sysdeps/x86_64/multiarch/strncmp-sse2.S b/sysdeps/x86_64/multiarch/strncmp-sse2.S index cc5252d826..a5ecb82b13 100644 --- a/sysdeps/x86_64/multiarch/strncmp-sse2.S +++ b/sysdeps/x86_64/multiarch/strncmp-sse2.S @@ -18,10 +18,13 @@ #include -#define STRCMP __strncmp_sse2 - -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(strcmp) +#if IS_IN (libc) +# define STRCMP __strncmp_sse2 +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(strcmp) +#else +# define STRCMP strncmp +#endif #define USE_AS_STRNCMP #include