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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B714AC47404 for ; Sat, 12 Oct 2019 03:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B1C821835 for ; Sat, 12 Oct 2019 03:23:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="J0pgg8cc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbfJLDXX (ORCPT ); Fri, 11 Oct 2019 23:23:23 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:53551 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbfJLDXX (ORCPT ); Fri, 11 Oct 2019 23:23:23 -0400 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x9C3Mvbg032318; Sat, 12 Oct 2019 12:22:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x9C3Mvbg032318 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570850578; bh=AzVFdYtQgZNSjO2R+li0ag0FvODB9DQNFkD9W0UZhWc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=J0pgg8ccnM+XYJ+pD8J6RLtLn1VsDZijOg7QVA9iGfoNRgVElYcw5cEwRDsWoq3Uc mVTnVDu2l6S73/QYImKlEhLqF4mOb7nrcpWZBVleF0Zu/lUjEEbe2NdtuXP7GMVZPM G+R+j57GRojdpkS1nuOyUCRvozJMaJegmxmb19Kdm6UTm1H3NnAKLFKYpY0fttDZHr wfta9gWPqJTTnBmToYTSw0JzbaQnv5h4v9DqmBcqbESSjsiyDhQWeGxzq/Tbfh/liT NGHU2K9Exa92blbjsoheFV+P9L78T2hL5qRWh6ATDGZhs0eJrkQaeTM9cdcxHm4Mib 0B48zknkOk+Ag== X-Nifty-SrcIP: [209.85.222.41] Received: by mail-ua1-f41.google.com with SMTP id 107so3631707uau.5; Fri, 11 Oct 2019 20:22:57 -0700 (PDT) X-Gm-Message-State: APjAAAUh6t2keBJtTuYNw5MT/UbA6BPYuw403ok+OUTJ1u+ItdDE4nKJ 49p0LUb4mgMV1nE+6a//h8J949hSNwQAAXafEhw= X-Google-Smtp-Source: APXvYqwxa0+cZ3+BwYhqg+6/lVQXvwK7zHJQu1iLJsgbN6veEmooghiHDltRaMfDtn/qoUlXh02XVKETuUHcT7Yf+00= X-Received: by 2002:ab0:59ed:: with SMTP id k42mr10261534uad.25.1570850576823; Fri, 11 Oct 2019 20:22:56 -0700 (PDT) MIME-Version: 1.0 References: <20191010151443.7399-1-maennich@google.com> <20191010151443.7399-3-maennich@google.com> In-Reply-To: <20191010151443.7399-3-maennich@google.com> From: Masahiro Yamada Date: Sat, 12 Oct 2019 12:22:20 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/4] modpost: make updating the symbol namespace explict To: Matthias Maennich Cc: Linux Kernel Mailing List , "Cc: Android Kernel" , Jessica Yu , Martijn Coenen , Lucas De Marchi , Shaun Ruffell , Greg Kroah-Hartman , Will Deacon , Linux Kbuild mailing list , linux-modules Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: Archived-At: List-Archive: List-Post: On Fri, Oct 11, 2019 at 12:16 AM Matthias Maennich wrote: > > Setting the symbol namespace of a symbol within sym_add_exported feels > displaced and lead to issues in the current implementation of symbol > namespaces. This patch makes updating the namespace an explicit call to > decouple it from adding a symbol to the export list. > > Signed-off-by: Matthias Maennich > --- Reviewed-by: Masahiro Yamada > scripts/mod/modpost.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 9f5dcdff4d2f..46137b730447 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -382,8 +382,8 @@ static void sym_update_namespace(const char *symname, const char *namespace) > * Add an exported symbol - it may have already been added without a > * CRC, in this case just update the CRC > **/ > -static struct symbol *sym_add_exported(const char *name, const char *namespace, > - struct module *mod, enum export export) > +static struct symbol *sym_add_exported(const char *name, struct module *mod, > + enum export export) > { > struct symbol *s = find_symbol(name); > > @@ -399,7 +399,6 @@ static struct symbol *sym_add_exported(const char *name, const char *namespace, > s->module = mod; > } > } > - sym_update_namespace(name, namespace); > s->preloaded = 0; > s->vmlinux = is_vmlinux(mod->name); > s->kernel = 0; > @@ -761,7 +760,8 @@ static void handle_modversions(struct module *mod, struct elf_info *info, > if (strstarts(symname, "__ksymtab_")) { > name = symname + strlen("__ksymtab_"); > namespace = sym_extract_namespace(&name); > - sym_add_exported(name, namespace, mod, export); > + sym_add_exported(name, mod, export); > + sym_update_namespace(name, namespace); > free(namespace); > } > if (strcmp(symname, "init_module") == 0) > @@ -2469,12 +2469,12 @@ static void read_dump(const char *fname, unsigned int kernel) > mod = new_module(modname); > mod->skip = 1; > } > - s = sym_add_exported(symname, namespace, mod, > - export_no(export)); > + s = sym_add_exported(symname, mod, export_no(export)); > s->kernel = kernel; > s->preloaded = 1; > s->is_static = 0; > sym_update_crc(symname, mod, crc, export_no(export)); > + sym_update_namespace(symname, namespace); > } > release_file(file, size); > return; > -- > 2.23.0.581.g78d2f28ef7-goog > -- Best Regards Masahiro Yamada