From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD3F1C46467 for ; Fri, 16 Dec 2022 11:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbiLPL5K (ORCPT ); Fri, 16 Dec 2022 06:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiLPL5J (ORCPT ); Fri, 16 Dec 2022 06:57:09 -0500 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68A3B264F; Fri, 16 Dec 2022 03:57:08 -0800 (PST) Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4NYSJK5z16z1r15N; Fri, 16 Dec 2022 12:57:05 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4NYSJK33KXz1qqlR; Fri, 16 Dec 2022 12:57:05 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id qdIf7S9_5Cgo; Fri, 16 Dec 2022 12:57:03 +0100 (CET) X-Auth-Info: I9LqOxI019SRTRCJIUeMssxvg6YNOJZppYTy2eQwvJzS6pIPt2lkGXfejHqM6Sjd Received: from igel.home (aftr-62-216-205-197.dynamic.mnet-online.de [62.216.205.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 16 Dec 2022 12:57:03 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id AA35E2C31C2; Fri, 16 Dec 2022 12:57:03 +0100 (CET) From: Andreas Schwab To: "Leizhen (ThunderTown)" Cc: Geert Uytterhoeven , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , , , Masahiro Yamada , Alexei Starovoitov , Jiri Olsa , Kees Cook , Andrew Morton , Luis Chamberlain , , Steven Rostedt , Ingo Molnar , David Laight , linux-m68k , "Jason A. Donenfeld" Subject: Re: [PATCH v9] kallsyms: Add self-test facility References: <20221115083349.1662-1-thunder.leizhen@huawei.com> <49070ac3-02bb-a3b3-b929-ede07e3b2c95@huawei.com> <4aaede14-8bd3-6071-f17b-7efcb5f0de42@huawei.com> <66ec4021-b633-09ba-73ee-b24cdb3fa25a@huawei.com> X-Yow: Is there something I should be DOING with a GLAZED DONUT?? Date: Fri, 16 Dec 2022 12:57:03 +0100 In-Reply-To: <66ec4021-b633-09ba-73ee-b24cdb3fa25a@huawei.com> (Leizhen's message of "Fri, 16 Dec 2022 17:36:30 +0800") Message-ID: <87h6xvk1dc.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: On Dez 16 2022, Leizhen (ThunderTown) wrote: > It seems that the problem is still strcmp(). After I commented strcmp() in > arch/m68k/include/asm/string.h, and force it to use the one in lib/string.c, > it works well. Does that help? diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index f759d944c449..cdafd67774e0 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -42,18 +42,19 @@ static inline char *strncpy(char *dest, const char *src, size_t n) #define __HAVE_ARCH_STRCMP static inline int strcmp(const char *cs, const char *ct) { - char res; + int res = 0, tmp = 0; asm ("\n" "1: move.b (%0)+,%2\n" /* get *cs */ - " cmp.b (%1)+,%2\n" /* compare a byte */ + " move.b (%1)+,%3\n" /* get *ct */ + " cmp.b %3,%2\n" /* compare a byte */ " jne 2f\n" /* not equal, break out */ " tst.b %2\n" /* at end of cs? */ " jne 1b\n" /* no, keep going */ " jra 3f\n" /* strings are equal */ - "2: sub.b -(%1),%2\n" /* *cs - *ct */ + "2: sub.l %3,%2\n" /* *cs - *ct */ "3:" - : "+a" (cs), "+a" (ct), "=d" (res)); + : "+a" (cs), "+a" (ct), "+d" (res), "+d" (tmp)); return res; } #endif /* CONFIG_COLDFIRE */ -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."