From patchwork Sat Oct 23 23:24:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 46565 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D198385781D for ; Sat, 23 Oct 2021 23:25:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D198385781D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635031519; bh=LuRZ16gkMqD0nA9MulBghc29a5tJEAogp98dZMoUpEU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HFhoKZQx8UOd54Oa4RY3V2SI/szqdX154dd71NwodHkyO6ADybcOW5z6lssbxKmRF Kdi+AT02sKbZL7HnGz01FLMejMHz1KUuy5saqVH8axG/Ov901h0SMe7HdoHJlR0vFH ze13WRhirD+2hQtKrF/eiP5KhccEvywEzvk7RBZY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 0B969385782F for ; Sat, 23 Oct 2021 23:24:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B969385782F Received: by mail-il1-x12c.google.com with SMTP id y17so8472205ilb.9 for ; Sat, 23 Oct 2021 16:24:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LuRZ16gkMqD0nA9MulBghc29a5tJEAogp98dZMoUpEU=; b=uotkC3Ht+UR5LMfl2N0vL5NDWQeDa79gjvK34W55+FJfy8cFHTkeHB5NRIVBuzrn9Y SE2/xTNPfzQRFhU7UmFlqoJXFTCZMXeTdYAIfM+anQekabJ9a70Lvr+FWzvgorFyHb7p vsayDerW4kNfj4pCwNRcxHR+qQ3oRGsVGPFUMgLLASZMsFUFCSLyTHMq0ObhzynMn+Ex s4TyCrKvoI8Q8pIcFMk/prNG6iQLG7HNvwOJ33WtC4CeRD09GRr54dUDFl+d+9e+vJmM UVG3SUfe2hE1OEwcE6QF9o7RBgO803xJaSgnFmcbJXju1jL4pM0aRS59XG5JYP+JxWkw kgcQ== X-Gm-Message-State: AOAM531CUTqNusroz3NdDowRjWMuKDzI6YkFatI3ZqGJaZggEOsuXBx/ cyi/T48Wo6mMZWHbUVQTkVv2mvoqrV4= X-Google-Smtp-Source: ABdhPJwTfoNJsvRtOe4cZjrwSeYWIHzODm//oISXJd1KfBgIyAShqgeUiaurGrkRbkuoFfNTFTfBEg== X-Received: by 2002:a92:c84b:: with SMTP id b11mr4760536ilq.285.1635031453323; Sat, 23 Oct 2021 16:24:13 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id g13sm773757ild.87.2021.10.23.16.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Oct 2021 16:24:13 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Date: Sat, 23 Oct 2021 18:24:02 -0500 Message-Id: <20211023232404.622433-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211023232404.622433-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20211023232404.622433-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds hidden defs for all declarations of __memcmpeq. This enables usage of __memcmpeq without the PLT for usage internal to GLIBC. Reviewed-by: H.J. Lu --- include/string.h | 1 + string/memcmp.c | 1 + sysdeps/aarch64/memcmp.S | 1 + sysdeps/csky/abiv2/memcmp.S | 1 + sysdeps/i386/i686/memcmp.S | 1 + sysdeps/i386/i686/multiarch/memcmp-ia32.S | 4 ++++ sysdeps/i386/i686/multiarch/memcmp.c | 1 + sysdeps/i386/memcmp.S | 1 + sysdeps/ia64/memcmp.S | 1 + sysdeps/powerpc/powerpc32/405/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S | 3 +++ sysdeps/powerpc/powerpc32/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 + sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S | 2 ++ sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S | 2 ++ sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S | 2 ++ sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S | 2 ++ sysdeps/powerpc/powerpc64/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power8/memcmp.S | 1 + sysdeps/s390/memcmp-z900.S | 1 + sysdeps/s390/memcmp.c | 1 + sysdeps/sparc/sparc64/memcmp.S | 1 + sysdeps/x86_64/memcmp.S | 1 + sysdeps/x86_64/multiarch/memcmp-sse2.S | 3 +++ sysdeps/x86_64/multiarch/memcmp.c | 1 + 27 files changed, 38 insertions(+) diff --git a/include/string.h b/include/string.h index 81dab39891..21f641a413 100644 --- a/include/string.h +++ b/include/string.h @@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim); libc_hidden_proto (__strsep_g) libc_hidden_proto (strnlen) libc_hidden_proto (__strnlen) +libc_hidden_proto (__memcmpeq) libc_hidden_proto (memmem) extern __typeof (memmem) __memmem; libc_hidden_proto (__memmem) diff --git a/string/memcmp.c b/string/memcmp.c index eac4112530..4620e79f29 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) +libc_hidden_def(__memcmpeq) diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index 37f37b9191..5dc4ee5f0b 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S index 2a4ae577b0..9aacfd4cab 100644 --- a/sysdeps/csky/abiv2/memcmp.S +++ b/sysdeps/csky/abiv2/memcmp.S @@ -140,4 +140,5 @@ END (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) libc_hidden_def (memcmp) +libc_hidden_def (__memcmpeq) .weak memcmp diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S index 90266d904b..cc3329bef4 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S index a5b5c3d349..74188f74ab 100644 --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S @@ -26,6 +26,10 @@ used by IFUNC. */ # define libc_hidden_builtin_def(name) \ .globl __GI_memcmp; __GI_memcmp = memcmp + +# undef libc_hidden_def +# define libc_hidden_def(name) \ + .globl __GI___memcmpeq; __GI___memcmpeq = __memcmpeq # endif # undef weak_alias diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c index 3b2815edbc..eb7cb9f2e2 100644 --- a/sysdeps/i386/i686/multiarch/memcmp.c +++ b/sysdeps/i386/i686/multiarch/memcmp.c @@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 02473c2c0c..f224db4681 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S index 7722908751..3ab04d4f8a 100644 --- a/sysdeps/ia64/memcmp.S +++ b/sysdeps/ia64/memcmp.S @@ -162,3 +162,4 @@ END(memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S index c2836040a7..339091be0d 100644 --- a/sysdeps/powerpc/powerpc32/405/memcmp.S +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S @@ -127,3 +127,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp,bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S index f58e34aba5..0df97dbf49 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S @@ -1374,3 +1374,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S index b17d0e43b7..cb1338c650 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S @@ -35,6 +35,9 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) +#undef libc_hidden_def +#define libc_hidden_def(name) + #undef weak_alias #define weak_alias(a, b) diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S index f8deb4e32c..25be9a7f51 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S @@ -1374,3 +1374,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S index f81c73a29c..b0cd3ddde7 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S @@ -178,3 +178,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S index 22399f143d..07a83b07b9 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S @@ -20,6 +20,8 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) +#undef libc_hidden_def +#define libc_hidden_def(name) #undef weak_alias #define weak_alias(name,alias) #undef strong_alias diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S index fe68912a3b..3308222a4b 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S @@ -20,6 +20,8 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) +#undef libc_hidden_def +#define libc_hidden_def(name) #undef weak_alias #define weak_alias(name,alias) #undef strong_alias diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S index 5739471a7d..b02174b328 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S @@ -20,6 +20,8 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) +#undef libc_hidden_def +#define libc_hidden_def(name) #undef weak_alias #define weak_alias(name,alias) #undef strong_alias diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S index e6a93e88c6..5eb4b58691 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S @@ -20,6 +20,8 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) +#undef libc_hidden_def +#define libc_hidden_def(name) #undef weak_alias #define weak_alias(name,alias) #undef strong_alias diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S index cc82be115f..3731bb0a73 100644 --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S @@ -1375,3 +1375,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S index 3044f7ede9..29ae19d843 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S @@ -1060,3 +1060,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S index 0c6a154502..897a5713ce 100644 --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S @@ -1443,3 +1443,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S index d625bf90dd..5808f9365d 100644 --- a/sysdeps/s390/memcmp-z900.S +++ b/sysdeps/s390/memcmp-z900.S @@ -165,6 +165,7 @@ END(MEMCMP_Z196) strong_alias (MEMCMP_DEFAULT, memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif #if defined SHARED && IS_IN (libc) diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c index 52c20af772..cc58279389 100644 --- a/sysdeps/s390/memcmp.c +++ b/sysdeps/s390/memcmp.c @@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp, ) weak_alias (memcmp, bcmp); strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index fefeee5f5d..d237945554 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S index 1b351ee092..8a03e572e8 100644 --- a/sysdeps/x86_64/memcmp.S +++ b/sysdeps/x86_64/memcmp.S @@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S index af737c5e6c..7b30b7ca2e 100644 --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S @@ -22,6 +22,9 @@ # ifdef SHARED # undef libc_hidden_builtin_def # define libc_hidden_builtin_def(name) + +# undef libc_hidden_def +# define libc_hidden_def(ignored) # endif # undef weak_alias diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c index 4a3aad2c9c..7b3409b1dd 100644 --- a/sysdeps/x86_64/multiarch/memcmp.c +++ b/sysdeps/x86_64/multiarch/memcmp.c @@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) # undef __memcmpeq strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) # ifdef SHARED __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)