From patchwork Fri Oct 22 19:46:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1545095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=py5/gY2G; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbZdg1S8Mz9sRN for ; Sat, 23 Oct 2021 06:48:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 320293857810 for ; Fri, 22 Oct 2021 19:48:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 320293857810 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634932084; bh=O+JemhPRCSX98Z2AdJ7XEV7LLHgsyHBdqmHzTkukNqs=; 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=py5/gY2GeBguo0lDaQ+F3pdqMPoYZaosWyfqhqKpuUuVQC9LIn70wGYDvenco4lV2 GvhjURBzWCJ3+P1J3lA+ab5fz1ZaU21SDMVog9rRPCapg5jAmOwplvXIi1mPvK+lAC 7Uk8zX+1xLHWwyhjnEFjmNTSDgdtM0B6hbWFTvTo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 000EF3858416 for ; Fri, 22 Oct 2021 19:47:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 000EF3858416 Received: by mail-il1-x132.google.com with SMTP id j10so2130758ilu.2 for ; Fri, 22 Oct 2021 12:47:04 -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=O+JemhPRCSX98Z2AdJ7XEV7LLHgsyHBdqmHzTkukNqs=; b=dYfQDTuJF66F5pxK0FfozasrDUFJlWn5wcYAccfFK6cOW9dKLewPHKPRpzaXv97uV8 AiSLIQSnVF4hei4HNA5Q6pALn6Io83UMZdTRL4RDxma0rCbwX7g1gV+C1PJxOaXewPCP vwDX2XanxTHR1Tw2ncxHG76h3RuznbzfPW0vmPRGWjhJD9q9irl4/ZPaovpA2wpEiZzM dzKTDc2L5LwWlJwxNv7J1JCtdcBQBpr7xB5BpVP+vReEBmyef6TFlQbVAbza4MFr6yFU eVyIrx5yBt801OgU+fzr/UYDCf6Wy2XhWk6tcg2JDReeGPBWMRcR7XBdtVHagrfH+uKH FtEQ== X-Gm-Message-State: AOAM532OX0R8iHDkustD3g3C7axM2B5SeLwyqjDmQvLtTZdRpbf5EVcP wbWLowfOF8olKNIyF/1VgW+zx8axWE8= X-Google-Smtp-Source: ABdhPJznbM7gg4zpcjtYw4IxXY6NgdW7Tow4nHVSTSrPsTScZ1UHpTmLP2nMt4twj4o/4tStw5hrCA== X-Received: by 2002:a92:7a10:: with SMTP id v16mr1210306ilc.112.1634932023706; Fri, 22 Oct 2021 12:47:03 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id k4sm5066313ilv.9.2021.10.22.12.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 12:47:03 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Date: Fri, 22 Oct 2021 14:46:55 -0500 Message-Id: <20211022194658.1919295-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210927203827.2852935-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds support for __memcmpeq() as a new ABI for all targets. In this commit __memcmpeq() is implemented only as an alias to the corresponding targets memcmp() implementation. __memcmpeq() is added as a new symbol starting with GLIBC_2.35 and defined in string.h with comments explaining its behavior. Basic tests that it is callable and works where added in string/tester.c As discussed in the proposal "Add new ABI '__memcmpeq()' to libc" __memcmpeq() is essentially a reserved namespace for bcmp(). The means is shares the same specifications as memcmp() except the return value for non-equal byte sequences is any non-zero value. This is less strict than memcmp()'s return value specification and can be better optimized when a boolean return is all that is needed. __memcmpeq() is meant to only be called by compilers if they can prove that the return value of a memcmp() call is only used for its boolean value. All tests in string/tester.c passed. As well build succeeds on x86_64-linux-gnu target. --- string/Versions | 3 +++ string/memcmp.c | 2 ++ string/string.h | 16 ++++++++++++++++ string/tester.c | 16 ++++++++++++++++ sysdeps/aarch64/memcmp.S | 2 ++ sysdeps/csky/abiv2/memcmp.S | 1 + sysdeps/i386/i686/memcmp.S | 8 ++++++++ sysdeps/i386/i686/multiarch/memcmp.c | 1 + sysdeps/i386/memcmp.S | 2 ++ sysdeps/ia64/memcmp.S | 1 + sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/powerpc/powerpc32/405/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 + 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 | 2 ++ sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arc/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../unix/sysv/linux/m68k/coldfire/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../unix/sysv/linux/microblaze/be/libc.abilist | 1 + .../unix/sysv/linux/microblaze/le/libc.abilist | 1 + .../unix/sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../unix/sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../unix/sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../linux/powerpc/powerpc32/nofpu/libc.abilist | 1 + .../sysv/linux/powerpc/powerpc64/be/libc.abilist | 1 + .../sysv/linux/powerpc/powerpc64/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc32/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 1 + sysdeps/x86_64/memcmp.S | 7 +++++++ sysdeps/x86_64/multiarch/memcmp.c | 2 ++ 55 files changed, 105 insertions(+) diff --git a/string/Versions b/string/Versions index 298ecd401a..864c4cf7a4 100644 --- a/string/Versions +++ b/string/Versions @@ -89,4 +89,7 @@ libc { sigdescr_np; sigabbrev_np; strerrordesc_np; strerrorname_np; } + GLIBC_2.35 { + __memcmpeq; + } } diff --git a/string/memcmp.c b/string/memcmp.c index 9b46d7a905..6e93a3128f 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp) #ifdef weak_alias # undef bcmp weak_alias (memcmp, bcmp) +# undef __memcmpeq +strong_alias (memcmp, __memcmpeq) #endif diff --git a/string/string.h b/string/string.h index b1b083edce..e70feeaeea 100644 --- a/string/string.h +++ b/string/string.h @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); extern int memcmp (const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); +/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equal. + Return some non-zero value otherwise. + + Essentially __memcmpeq has the exact same semantics as memcmp + except the return value is less constrained. memcmp is always a + correct implementation of __memcmpeq. As well !!memcmp, -memcmp, + or bcmp are correct implementations. + + __memcmpeq is meant to be used by compilers when memcmp return is + only used for its bolean value. + + __memcmpeq is declared only for use by compilers. Programs should + continue to use memcmp. */ +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) + __THROW __attribute_pure__ __nonnull ((1, 2)); + /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" diff --git a/string/tester.c b/string/tester.c index 778160ae6e..605b3f00f9 100644 --- a/string/tester.c +++ b/string/tester.c @@ -1449,6 +1449,19 @@ test_bcmp (void) check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */ } +static void +test_memcmpeq (void) +{ + it = "__memcmpeq"; + check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity. */ + check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter. */ + check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal. */ + check (__memcmpeq ("abce", "abcd", 4) != 0, 4); + check (__memcmpeq ("alph", "beta", 4) != 0, 5); + check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited. */ + check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count. */ +} + static void test_strerror (void) { @@ -1611,6 +1624,9 @@ main (void) /* bcmp - somewhat like memcmp. */ test_bcmp (); + /* __memcmpeq - somewhat like memcmp. */ + test_memcmpeq (); + /* strndup. */ test_strndup (); diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index c1937f6f5c..37f37b9191 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -177,4 +177,6 @@ L(ret_0): END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S index 1560387618..2a4ae577b0 100644 --- a/sysdeps/csky/abiv2/memcmp.S +++ b/sysdeps/csky/abiv2/memcmp.S @@ -138,5 +138,6 @@ ENTRY (memcmp) br .L_s1_aligned END (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) libc_hidden_def (memcmp) .weak memcmp diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S index b26b124fad..acc702bd34 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -405,4 +405,12 @@ L(table_32bytes) : #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +#ifdef USE_MULTIARCH +/* Weak alias for __memcmpeq here as it will be preempted by + definition coming from IFUNC in multiarch/memcmp.c. */ +weak_alias (memcmp, __memcmpeq) +#else +strong_alias (memcmp, __memcmpeq) +#endif libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c index 6e058a8857..3b2815edbc 100644 --- a/sysdeps/i386/i686/multiarch/memcmp.c +++ b/sysdeps/i386/i686/multiarch/memcmp.c @@ -29,4 +29,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) #endif diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 1f212b0f6d..02473c2c0c 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -70,4 +70,6 @@ END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S index 97539c23fd..7722908751 100644 --- a/sysdeps/ia64/memcmp.S +++ b/sysdeps/ia64/memcmp.S @@ -160,4 +160,5 @@ ENTRY(memcmp) END(memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index c5da10a0cd..e849d6fa35 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F GLIBC_2.34 shm_open F GLIBC_2.34 shm_unlink F GLIBC_2.34 timespec_getres F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S index 6a6a54d90f..c2836040a7 100644 --- a/sysdeps/powerpc/powerpc32/405/memcmp.S +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S @@ -126,3 +126,4 @@ L(st2): END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp,bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S index 814d2f211d..f58e34aba5 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S @@ -1373,3 +1373,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S index 8a19953e2d..f8deb4e32c 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S @@ -1373,3 +1373,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S index 52f244e7e7..f81c73a29c 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S @@ -177,3 +177,4 @@ L(tail8): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S index dc1be3a0d8..cc82be115f 100644 --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S @@ -1374,3 +1374,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S index bc034a55bc..3044f7ede9 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S @@ -1059,3 +1059,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S index b676b09a9b..0c6a154502 100644 --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S @@ -1442,3 +1442,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S index 995d52e47d..d625bf90dd 100644 --- a/sysdeps/s390/memcmp-z900.S +++ b/sysdeps/s390/memcmp-z900.S @@ -164,6 +164,7 @@ END(MEMCMP_Z196) Otherwise see sysdeps/s390/memcmp.c. */ strong_alias (MEMCMP_DEFAULT, memcmp) weak_alias (memcmp, bcmp) +strong_alias (memcmp, __memcmpeq) #endif #if defined SHARED && IS_IN (libc) diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c index 0b4e9da717..52c20af772 100644 --- a/sysdeps/s390/memcmp.c +++ b/sysdeps/s390/memcmp.c @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp, }) ) weak_alias (memcmp, bcmp); +strong_alias (memcmp, __memcmpeq) #endif diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index d8d9ff9b24..fefeee5f5d 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -137,4 +137,6 @@ END(memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 21a2e50a88..f227ae6cee 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index a201fd69ba..0ccc3fc73e 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 2611436937..fd80704787 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index a426241965..2ae6c58b8a 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 02f80418cc..fcfd1e8594 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index b7676eb372..ba034b8541 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index f6965c9d95..b7460bec8a 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 2e7603d9ed..a4dc341ded 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index dd3a56d3fe..94b222dbc7 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index c1e0ea9c10..12fd3b6310 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 GLIBC_2.4 _IO_2_1_stdin_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 93161048ca..4d2296007a 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 0aaeec8a27..a223278a3d 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index bec5f456c9..780a4f5b0b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 97d2127f78..cd65136062 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index acb0756c11..b5b9902db5 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index ebc21dde1e..57593d5f94 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index c68f7e3c6c..e944d76bed 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index e5b6834f14..8af5a3a90d 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 132707c8ad..3a0213b39f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 0af2be31a0..f57df0234b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index cf864632d0..259a0cfc51 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index d566d675d0..126541daf1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index c9a7eacb32..05df4d13d2 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 8299131cb2..8e349cbff8 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index c3fe78f77f..e9de402766 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 83e542aa8c..1a010c745d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index dc502f6833..22ce530975 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index cba1abb556..960df07b83 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index d4a516fb47..eedb376f3d 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 6268875ba3..86e0c92bef 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 095e914b73..5e59d90623 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index dd910f7fe9..94412dc134 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __memcmpeq F diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S index 870e15c5a0..2fa79edd47 100644 --- a/sysdeps/x86_64/memcmp.S +++ b/sysdeps/x86_64/memcmp.S @@ -358,4 +358,11 @@ END(memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#ifdef USE_MULTIARCH +/* Weak alias for __memcmpeq here as it will be preempted by + definition coming from IFUNC in multiarch/memcmp.c. */ +weak_alias (memcmp, __memcmpeq) +#else +strong_alias (memcmp, __memcmpeq) +#endif libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c index fe725f3563..4a3aad2c9c 100644 --- a/sysdeps/x86_64/multiarch/memcmp.c +++ b/sysdeps/x86_64/multiarch/memcmp.c @@ -29,6 +29,8 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); # undef bcmp weak_alias (memcmp, bcmp) +# undef __memcmpeq +strong_alias (memcmp, __memcmpeq) # ifdef SHARED __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp) From patchwork Fri Oct 22 19:46:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1545094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=VdaBQO0O; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbZcr4cy0z9sRN for ; Sat, 23 Oct 2021 06:47:24 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB464385782D for ; Fri, 22 Oct 2021 19:47:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB464385782D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634932041; bh=1ZPhSBFN9zM4D0Vqglx2cg0CAO3L5cUrskbGavsaUVE=; 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=VdaBQO0OpUjhDzdVmG347Iwv/KwbwlGe0OM7weXG6bPwDGtIQwPZtHFVZgda1VUh5 DK/LMIGhR9QpOvncI9XFOwgIycU+bItcEwVAH1aJylS984vb9BX9XqBKbIIImtvZY9 +QbTzWSKO9Upo3LsS7QNsl6QJHduTmRHO1QnVOIA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 182023857C52 for ; Fri, 22 Oct 2021 19:47:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 182023857C52 Received: by mail-il1-x12d.google.com with SMTP id w15so3976819ilv.5 for ; Fri, 22 Oct 2021 12:47:06 -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=1ZPhSBFN9zM4D0Vqglx2cg0CAO3L5cUrskbGavsaUVE=; b=rX4nVxA3dv5t40D1QvvMi5VSQaSCXC7qe96mpPSHO3onAxhlds5yxZms4oyHfaJ0Oq TqeK34lN4du21IZWirkmELCEqaFFhF0cVbYUeb9B6jsWCpB/lP8rraFNqEF0EItxoR0G rvACbIP0wFh3zqS16sOd7r/fYd9/htPhuTJXNebPt5DF7rvV4Vt1chxSR8jpF8E3mySH 85IzwJdw9H4ru02KTNKrtnpDxeNFq7PvIdHdIArHTDul2+f4zCAa8tSnPVbT+R4YX+mO KHVWxezQ9gXSiDG/QXG89w3Gov7563c2oiBi2S8NmdrG1BHp9LEQc1jIO8WAt/h/mNWH mCTQ== X-Gm-Message-State: AOAM53292ff1y6qY8nbdJVzTgVR41IMdsScFwIgd3Ttq3Xh3MmMd/BDh 9AtNAi038npkN7TpZnFP4k1aHNqaWQw= X-Google-Smtp-Source: ABdhPJyel6okUsAnB7gFeHeEBpB+952CiJoI1yqCbKR1ZRL6wXm7G6VfTMsI5+zm4tjSNM6sP8l6UA== X-Received: by 2002:a05:6e02:12c2:: with SMTP id i2mr1200646ilm.223.1634932025206; Fri, 22 Oct 2021 12:47:05 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id k4sm5066313ilv.9.2021.10.22.12.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 12:47:04 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Date: Fri, 22 Oct 2021 14:46:56 -0500 Message-Id: <20211022194658.1919295-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022194658.1919295-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20211022194658.1919295-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+incoming=patchwork.ozlabs.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. --- 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.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/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 + 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.c | 1 + 20 files changed, 20 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 6e93a3128f..dc1a94e6ea 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp) weak_alias (memcmp, bcmp) # undef __memcmpeq strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif 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 acc702bd34..c5e4453898 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -414,3 +414,4 @@ weak_alias (memcmp, __memcmpeq) strong_alias (memcmp, __memcmpeq) #endif libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) 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/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/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 2fa79edd47..7e77c4e5a1 100644 --- a/sysdeps/x86_64/memcmp.S +++ b/sysdeps/x86_64/memcmp.S @@ -366,3 +366,4 @@ weak_alias (memcmp, __memcmpeq) strong_alias (memcmp, __memcmpeq) #endif libc_hidden_builtin_def (memcmp) +libc_hidden_builtin_def (__memcmpeq) 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) From patchwork Fri Oct 22 19:46:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1545096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ryb7tM+5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbZfY2cVvz9sRN for ; Sat, 23 Oct 2021 06:48:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D47D385782C for ; Fri, 22 Oct 2021 19:48:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D47D385782C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634932131; bh=2SuAWMfUBDIpShpbF6wfV6cIVQe8rUe8J/PfVgv9psE=; 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=ryb7tM+5ekpiIo3POYX3wSryBwlm+AvGoCVBUKoi9M0CjXXUnPaY6PZkPqp9b0TK/ G8SMNkQlvzEn+fo1Bg5GnUaIPUijPxQet4wu/fVKYE8r+h7NiucM6IIz/sZ+T3KyyU yrRJchNWl+6ldqJRtbphSyXcRCgiHvx97pLwWxco= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id A677E3857C76 for ; Fri, 22 Oct 2021 19:47:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A677E3857C76 Received: by mail-io1-xd30.google.com with SMTP id y67so6798136iof.10 for ; Fri, 22 Oct 2021 12:47:07 -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=2SuAWMfUBDIpShpbF6wfV6cIVQe8rUe8J/PfVgv9psE=; b=cFi0sWz9Su/7RN5QUoubHhw/0n0dU6a51clY0xd62A2iLLHATFRM1/TPLcdbmRzXFy xgitvXQDtjl0VyLrwu7YMXsbktNczPM+JL51wLKwXAOv7ZfPU22JPzyCfOwhpkEhQF5x sM8JielSadPd1jS4pk+DN6ZaEeEUdhfs3wEfu4ZL2vYzGZ+30wPmqh18uR8lCspdaNi+ KISXYJidKQWxr/YqETjXtifSvlfA76yPzU/HOlNKUHxDoN2WSAe6Vk2NKxmmhyVUqQ6X QkeYjUHCdQzlzZDcy7YhEdhPvp0TcqgktYEzLXdtGAmRKgGM5EspV2fKThMLpc9wJI9C FjFw== X-Gm-Message-State: AOAM532deRTOJZqEN4l9QpI2D7FEInq3PCXLmpMSgbw5kcfxp0LLMpbe 4P1/+fno0M5Fu9Ysqk3h21A4ghEnnbg= X-Google-Smtp-Source: ABdhPJwFPRAlV7Y0ETXZij4qBwhTbeS8dvZA37hBreRFqQ2WPX8yt1clEpXdoikkJGo+dbyOJpfchw== X-Received: by 2002:a02:b60a:: with SMTP id h10mr1213981jam.50.1634932026681; Fri, 22 Oct 2021 12:47:06 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id k4sm5066313ilv.9.2021.10.22.12.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 12:47:06 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v12 3/4] String: Add tests for __memcmpeq Date: Fri, 22 Oct 2021 14:46:57 -0500 Message-Id: <20211022194658.1919295-3-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022194658.1919295-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20211022194658.1919295-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, KAM_SHORT, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds tests for the new function __memcmpeq. The new tests use the existing tests in 'test-memcmp.c' but relax the result requirement to only check for zero or non-zero returns. All string tests include test-memcmpeq are passing. --- string/Makefile | 4 ++-- string/test-memcmp.c | 34 ++++++++++++++++++++++------------ string/test-memcmpeq.c | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 string/test-memcmpeq.c diff --git a/string/Makefile b/string/Makefile index f0fce2a0b8..40d6fac133 100644 --- a/string/Makefile +++ b/string/Makefile @@ -48,8 +48,8 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \ sigdescr_np sigabbrev_np strerrorname_np \ strerrordesc_np -strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ - stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ +strop-tests := memchr memcmp memcpy memcmpeq memmove mempcpy memset \ + memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ strlen strncmp strncpy strpbrk strrchr strspn memmem \ strstr strcasestr strnlen strcasecmp strncasecmp \ strncat rawmemchr strchrnul bcopy bzero memrchr \ diff --git a/string/test-memcmp.c b/string/test-memcmp.c index 6ddbc05d2f..fdf148102c 100644 --- a/string/test-memcmp.c +++ b/string/test-memcmp.c @@ -17,11 +17,14 @@ . */ #define TEST_MAIN -#ifdef WIDE +#ifdef TEST_MEMCMPEQ +# define TEST_NAME "__memcmpeq" +#elif defined WIDE # define TEST_NAME "wmemcmp" #else # define TEST_NAME "memcmp" #endif + #include "test-string.h" #ifdef WIDE # include @@ -35,8 +38,9 @@ # define CHARBYTES 4 # define CHAR__MIN WCHAR_MIN # define CHAR__MAX WCHAR_MAX + int -simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) +SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n) { int ret = 0; /* Warning! @@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) } #else # include - -# define MEMCMP memcmp +# ifdef TEST_MEMCMPEQ +# define MEMCMP __memcmpeq +# define SIMPLE_MEMCMP simple_memcmpeq +# else +# define MEMCMP memcmp +# define SIMPLE_MEMCMP simple_memcmp +# endif # define MEMCPY memcpy -# define SIMPLE_MEMCMP simple_memcmp # define CHAR char # define MAX_CHAR 255 # define UCHAR unsigned char @@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) # define CHAR__MAX CHAR_MAX int -simple_memcmp (const char *s1, const char *s2, size_t n) +SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n) { int ret = 0; @@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n) } #endif +#ifndef BAD_RESULT +# define BAD_RESULT(result, expec) \ + (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) || \ + ((result) > 0 && (expec) <= 0)) +# endif + typedef int (*proto_t) (const CHAR *, const CHAR *, size_t); IMPL (SIMPLE_MEMCMP, 0) @@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len, int exp_result) { int result = CALL (impl, s1, s2, len); - if ((exp_result == 0 && result != 0) - || (exp_result < 0 && result >= 0) - || (exp_result > 0 && result <= 0)) + if (BAD_RESULT(result, exp_result)) { error (0, 0, "Wrong result in function %s %d %d", impl->name, result, exp_result); @@ -186,9 +198,7 @@ do_random_tests (void) { r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2, len); - if ((r == 0 && result) - || (r < 0 && result >= 0) - || (r > 0 && result <= 0)) + if (BAD_RESULT(r, result)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p", n, impl->name, align1 * CHARBYTES & 63, align2 * CHARBYTES & 63, len, pos, r, result, p1, p2); diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c new file mode 100644 index 0000000000..8889117868 --- /dev/null +++ b/string/test-memcmpeq.c @@ -0,0 +1,21 @@ +/* Test and measure __memcmpeq functions. + Copyright (C) 2012-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define BAD_RESULT(result, expec) ((!(result)) != (!(expec))) +#define TEST_MEMCMPEQ 1 +#include "test-memcmp.c" From patchwork Fri Oct 22 19:46:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1545097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=cQunB0TD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbZgM2m7hz9sRN for ; Sat, 23 Oct 2021 06:49:35 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4CAE13857815 for ; Fri, 22 Oct 2021 19:49:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CAE13857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634932173; bh=2UG3LQ60iiU7PDjkbPeGlJfrcLxvPq6JTacU6XR8wMo=; 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=cQunB0TD2HMqBGB2R1v54fFs8eQK+ujBfgE1GEnit774Qy8vPydAEBkzz7mm7i7+1 gidRMw3QW8hL5ijogKPsjvSe7KR9fNnJ+M13SZkymEQIclju4SIudk88GwlDgLRnd8 P1xLqaBWp3uArTFs8ZuUQo8hJvlgrep9VB3pZUC8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 5D43D3857C52 for ; Fri, 22 Oct 2021 19:47:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D43D3857C52 Received: by mail-il1-x136.google.com with SMTP id x1so5458342ilv.4 for ; Fri, 22 Oct 2021 12:47:08 -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=2UG3LQ60iiU7PDjkbPeGlJfrcLxvPq6JTacU6XR8wMo=; b=DhlUSiz+K/1qPApQXD5IW629jMd9IoKsEn751n8mBqpD2V8UKuLhaRhOIb2JfLAtQH wqNmZ1U8xJnzVnuXwrgIjlwvhs1fjw/VKBJ2tGgGZldFUQG5Ma8c94cQynP4DTOHfC1o X9//HmlPflGiqgs7KynHxkV57B4RjdQArv7YwTwTUxNxbFK4Lw58MsoR1lObtG3RzY1O oMETH/Cz6E/ZxJ17Rag13IzJ5EuTZ8L7nPdz7AvCoyvU9J3sq2gM+5LDnoXTBNptGmxG q/jUdh8qx7zUzJWHS0sR51eKV/MZrvSQq/hxD/4bxKwaQ97+0KafCPzV1LOdf4ozfViq iozw== X-Gm-Message-State: AOAM5319PCWsjBsoW5cFy/sTDBE8tLA3jf0kTgXH4BtxHZKH6nXqCD3Z MNl//WXIIoQME8/XMOegNO/r8z1Sy+I= X-Google-Smtp-Source: ABdhPJz0RcERTQru5aJdFkDsAYoaCFYUPBY93B/DmjtpXW4+hOxNvb6rJSA6/YRDz4YghN0bpu/7Qw== X-Received: by 2002:a05:6e02:b44:: with SMTP id f4mr1231801ilu.100.1634932027729; Fri, 22 Oct 2021 12:47:07 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id k4sm5066313ilv.9.2021.10.22.12.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 12:47:07 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v12 4/4] NEWS: Add item for __memcmpeq Date: Fri, 22 Oct 2021 14:46:58 -0500 Message-Id: <20211022194658.1919295-4-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022194658.1919295-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20211022194658.1919295-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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index b39b1e5e33..82b7016aef 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,10 @@ Major new features: DSO sorting algorithms. The default setting of '1' uses the current existing algorithm, while a value of '2' selects the new DFS-based algorithm. +* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant + to be used by compilers for optimizing usage of 'memcmp' when its + return value is only used for its boolean status. + Deprecated and removed features, and other changes affecting compatibility: * The r_version update in the debugger interface makes the glibc binary