Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1745106ybp; Fri, 11 Oct 2019 20:24:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVv3jGr3yEDQujSX3dMmyxl0KC//qu1J4IiZAGRdJ8Vtl77f7AHhAu1R/k8oy1hbqfMo21 X-Received: by 2002:a17:907:366:: with SMTP id rs6mr17180777ejb.232.1570850665870; Fri, 11 Oct 2019 20:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570850665; cv=none; d=google.com; s=arc-20160816; b=CZqguda6JASIz5AOaffg7oukFcaoYJegNLbq4v75jGbN362QINkSEpGMQfZw9IkYh7 O+sGjUfwd44zQigxtfZFXhJLWIzW5G2PKnj1rI5kUxxieFJaWeGjBJrEPcjhFfkqqouh pu/zHQKcnFK05TyqDcKgwGwH8FIKjyPIbOlf1ZHanQxdJ+ZEL38XNHeShLTRk0XHAaey fuiCB+NBkr3f5Q2+owK4dsDlTRQQfmSpSb2AJg2ZGzIWiHYcba2ErzF7K7MWqy2WjXK9 5laOKDBZFnj90yJRVtbYmbUSzpt2nKoLbNziL+Np9cS1KBJC1sHM9fq12DBSHDZ1C1ob hHAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=AzVFdYtQgZNSjO2R+li0ag0FvODB9DQNFkD9W0UZhWc=; b=MhX6IYViivkIRE0xdZ1kKwSQ5MDDExOgOU833I5Od8ytAb7d8R0Re7vmvOQyb8qYqX Fm+e7uL0IdE7rsa1lFHnMOqlVbbVMKhz2453U19hTzYMmwYBD0zQoZfI/9vrc/amDvBa dJJwzUaPjPqufYJTd5UZihcNdHIXMx0KAQn4AbFhg8MBRweVhr2aBSbmOQP2B5P9bTB8 m/e5YE5yPgu87HlBpNe30/8VQ5eLmrZS006eVmwrepejl+iaBV2wG25BFqhKO9EKMmeZ JCS5VOFDfynFVqvi0B/ob0NMtXxxfEffKcqGXG2xkp3W2vC3kuNzD0Q139yrMXoLgu3Q rE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=J0pgg8cc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si9470028edf.328.2019.10.11.20.24.02; Fri, 11 Oct 2019 20:24:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=J0pgg8cc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727594AbfJLDXX (ORCPT + 99 others); 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-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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