From: H.J. Lu Date: Wed, 20 Dec 2023 00:01:33 +0000 (-0800) Subject: Fix elf: Do not duplicate the GLIBC_TUNABLES string X-Git-Tag: glibc-2.39~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50bef9bd63e7fb94f1d2cc8b7809256ffc73b2ef;p=thirdparty%2Fglibc.git Fix elf: Do not duplicate the GLIBC_TUNABLES string commit 2a969b53c0b02fed7e43473a92f219d737fd217a Author: Adhemerval Zanella Date: Wed Dec 6 10:24:01 2023 -0300 elf: Do not duplicate the GLIBC_TUNABLES string has @@ -38,7 +39,7 @@ which isn't available. */ #define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len) \ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \ - if (memcmp (f, #name, len) == 0) \ + if (tunable_str_comma_strcmp_cte (&f, #name) == 0) \ { \ cpu_features->preferred[index_arch_##name] \ &= ~bit_arch_##name; \ @@ -46,12 +47,11 @@ Fix it by removing "== 0" after tunable_str_comma_strcmp_cte. --- diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c index ef96148d307..142c6b92401 100644 --- a/sysdeps/x86/cpu-tunables.c +++ b/sysdeps/x86/cpu-tunables.c @@ -39,7 +39,7 @@ which isn't available. */ #define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len) \ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \ - if (tunable_str_comma_strcmp_cte (&f, #name) == 0) \ + if (tunable_str_comma_strcmp_cte (&f, #name)) \ { \ cpu_features->preferred[index_arch_##name] \ &= ~bit_arch_##name; \