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 DE655C76196 for ; Fri, 7 Apr 2023 20:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbjDGURR (ORCPT ); Fri, 7 Apr 2023 16:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjDGURP (ORCPT ); Fri, 7 Apr 2023 16:17:15 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADED3C66A for ; Fri, 7 Apr 2023 13:16:59 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id q15-20020a17090a2dcf00b0023efab0e3bfso2279528pjm.3 for ; Fri, 07 Apr 2023 13:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680898619; x=1683490619; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GENUw9PqHBdUQEL7FlbS+wdO3dyU6tn18qubnwix7jU=; b=EaZapur5N7xnNq/YZo/eVlN61WzPv9HAnkbWBMyfaGhZ/0gJWIlsiyBVHWxzhdaw1t R72R8SmNCfn7gOE3iA3IHUCRcbAhGdJeVPIls4cJLB0T7xnifBLTjxGwcaOsvhJNJjI+ l7hNO+bW2f7jkalZpw4AgJ3knwDIHaHVEouKYGvexkGYcX+HfBZ4SCS4piD0U6/Vq4WK Mrr/ENhyEAyAZ3NGN1F+7exOIEN/OdgXkkifBZ+3wTF9MEgxikWSqb18Why1CqmTTPtH eMA2SSTXI6uONKq0K2JOwTHAUu8YZZgEKzwE/KtMm2vjPpmSEy4nuAC8cchlsU9vl8VE HaXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898619; x=1683490619; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GENUw9PqHBdUQEL7FlbS+wdO3dyU6tn18qubnwix7jU=; b=4Bd5tQGTrBv3IebvBL/lEiy75jil3SHyJhQuIB5PrVXizyH6jOfN5NC4XASzqb/9y8 bUXHQP8cgg+rUfNvzUTF425/RBDr8+n3r5NDL2VLUHc6c2vE23XOBpkEz4SSCxSKVAQ7 lLE8cQz3qKgjwvfdzPyRCiLgVthIg4SyY5Uc+0bD+S3Iz0MiR+vOG02Tt7iUHaMsq9Kc PjAICtFDJ6gip06oNib4kP6BagWcRX/wlcmOHW/HoXIzxbrcjAM3xWP2NlH2pPXIuR1l pEJfG3F9Y6RfqXKL8lBkYOVeQV0GODB0inW5kl51Z+pju0Lfc2wvGuT9z2ZGIwEGESdk UZWg== X-Gm-Message-State: AAQBX9deGCCvZjTKGX7yLZBuFoc2i39m+AzOP2w9oxBnuTkt4ysiTrJR +aASO4LgAyxs/27vK0FyKb75GYn41Cqbu1poW8+Npg== X-Google-Smtp-Source: AKy350ZCS9oS/E6rHTOEUBGi//7qEXg87vIrCUZNJ2ntFTukuiOYoRT5fpPKSGoUDyQro9/0w5iXN2I+1adj/vXTVZs= X-Received: by 2002:a17:902:7c10:b0:1a2:8871:b42a with SMTP id x16-20020a1709027c1000b001a28871b42amr1293738pll.2.1680898618741; Fri, 07 Apr 2023 13:16:58 -0700 (PDT) MIME-Version: 1.0 References: <20230308115243.82592-1-masahiroy@kernel.org> <20230308115243.82592-5-masahiroy@kernel.org> In-Reply-To: <20230308115243.82592-5-masahiroy@kernel.org> From: Nick Desaulniers Date: Fri, 7 Apr 2023 13:16:47 -0700 Message-ID: Subject: Re: [PATCH 5/8] scripts/kallsyms: move compiler-generated symbol patterns to mksysmap To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Zhen Lei , Arnd Bergmann , Nathan Chancellor , Nicolas Schier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On Wed, Mar 8, 2023 at 3:53=E2=80=AFAM Masahiro Yamada wrote: > > scripts/kallsyms.c maintains compiler-generated symbols, but we end up > with something similar in scripts/mksysmap to avoid the "Inconsistent > kallsyms data" error. For example, commit c17a2538704f ("mksysmap: Fix > the mismatch of 'L0' symbols in System.map"). > > They were separately maintained prior to commit 94ff2f63d6a3 ("kbuild: > reuse mksysmap output for kallsyms"). > > Now that scripts/kallsyms.c parses the output of scripts/mksysmap, > it makes more sense to collect all the ignored patterns to mksysmap. Cool, thanks for the patch! Reviewed-by: Nick Desaulniers > > Signed-off-by: Masahiro Yamada > --- > > scripts/kallsyms.c | 59 ---------------------------------------------- > scripts/mksysmap | 43 +++++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+), 59 deletions(-) > > diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c > index e572fda6fe42..97d514c0fc8f 100644 > --- a/scripts/kallsyms.c > +++ b/scripts/kallsyms.c > @@ -102,65 +102,6 @@ static char *sym_name(const struct sym_entry *s) > > static bool is_ignored_symbol(const char *name, char type) > { > - /* Symbol names that exactly match to the following are ignored.*= / > - static const char * const ignored_symbols[] =3D { > - "_SDA_BASE_", /* ppc */ > - "_SDA2_BASE_", /* ppc */ > - NULL > - }; > - > - /* Symbol names that begin with the following are ignored.*/ > - static const char * const ignored_prefixes[] =3D { > - "__efistub_", /* arm64 EFI stub namespace */ > - "__kvm_nvhe_$", /* arm64 local symbols in non-VHE= KVM namespace */ > - "__kvm_nvhe_.L", /* arm64 local symbols in non-VHE= KVM namespace */ > - "__AArch64ADRPThunk_", /* arm64 lld */ > - "__ARMV5PILongThunk_", /* arm lld */ > - "__ARMV7PILongThunk_", > - "__ThumbV7PILongThunk_", > - "__LA25Thunk_", /* mips lld */ > - "__microLA25Thunk_", > - "__kcfi_typeid_", /* CFI type identifiers */ > - NULL > - }; > - > - /* Symbol names that end with the following are ignored.*/ > - static const char * const ignored_suffixes[] =3D { > - "_from_arm", /* arm */ > - "_from_thumb", /* arm */ > - "_veneer", /* arm */ > - NULL > - }; > - > - /* Symbol names that contain the following are ignored.*/ > - static const char * const ignored_matches[] =3D { > - ".long_branch.", /* ppc stub */ > - ".plt_branch.", /* ppc stub */ > - NULL > - }; > - > - const char * const *p; > - > - for (p =3D ignored_symbols; *p; p++) > - if (!strcmp(name, *p)) > - return true; > - > - for (p =3D ignored_prefixes; *p; p++) > - if (!strncmp(name, *p, strlen(*p))) > - return true; > - > - for (p =3D ignored_suffixes; *p; p++) { > - int l =3D strlen(name) - strlen(*p); > - > - if (l >=3D 0 && !strcmp(name + l, *p)) > - return true; > - } > - > - for (p =3D ignored_matches; *p; p++) { > - if (strstr(name, *p)) > - return true; > - } > - > if (type =3D=3D 'u' || type =3D=3D 'n') > return true; > > diff --git a/scripts/mksysmap b/scripts/mksysmap > index 1efd61ee0bac..d8ad6ff69320 100755 > --- a/scripts/mksysmap > +++ b/scripts/mksysmap > @@ -36,6 +36,28 @@ ${NM} -n ${1} | sed >${2} -e " > # local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc. > / \.L/d > > +# arm64 EFI stub namespace > +/ __efistub_/d > + > +# arm64 local symbols in non-VHE KVM namespace > +/ __kvm_nvhe_\$/d > +/ __kvm_nvhe_\.L/d > + > +# arm64 lld > +/ __AArch64ADRPThunk_/d > + > +# arm lld > +/ __ARMV5PILongThunk_/d > +/ __ARMV7PILongThunk_/d > +/ __ThumbV7PILongThunk_/d > + > +# mips lld > +/ __LA25Thunk_/d > +/ __microLA25Thunk_/d > + > +# CFI type identifiers > +/ __kcfi_typeid_/d > + > # CRC from modversions > / __crc_/d > > @@ -45,6 +67,15 @@ ${NM} -n ${1} | sed >${2} -e " > # EXPORT_SYMBOL (namespace) > / __kstrtabns_/d > > +# ----------------------------------------------------------------------= ----- > +# Ignored suffixes > +# (do not forget '$' after each pattern) > + > +# arm > +/_from_arm$/d > +/_from_thumb$/d > +/_veneer$/d > + > # ----------------------------------------------------------------------= ----- > # Ignored symbols (exact match) > # (do not forget a space before and '$' after each pattern) > @@ -52,6 +83,18 @@ ${NM} -n ${1} | sed >${2} -e " > # for LoongArch? > / L0$/d > > +# ppc > +/ _SDA_BASE_$/d > +/ _SDA2_BASE_$/d > + > +# ----------------------------------------------------------------------= ----- > +# Ignored patterns > +# (symbols that contain the pattern are ignored) > + > +# ppc stub > +/\.long_branch\./d > +/\.plt_branch\./d > + > # ----------------------------------------------------------------------= ----- > # Ignored kallsyms symbols > # > -- > 2.34.1 > --=20 Thanks, ~Nick Desaulniers