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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7B704ECE58C for ; Fri, 11 Oct 2019 14:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 523DD2190F for ; Fri, 11 Oct 2019 14:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570803884; bh=ZUjomhQ6sr8aTI+2J7CgZ4YadulwLDa1WqH77eJw5CM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=bdr69G6GrFgZb0flfsTrACtTS7D0qkEHQ4dLMpbny/Kj5AUVP6cfuXKoU1QR1VV0S 36UGUEKQPzBQFmm5ihk2MYiWtbPRowhGiUDZPrEgjIAUH6bhTynaQd4WvR4vjzbfy4 j9UCUipVcZ2W8VP4pPpIn/SW4QUoKEPXsLAVUjB4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728361AbfJKOYo (ORCPT ); Fri, 11 Oct 2019 10:24:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728068AbfJKOYn (ORCPT ); Fri, 11 Oct 2019 10:24:43 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00D43206A1; Fri, 11 Oct 2019 14:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570803882; bh=ZUjomhQ6sr8aTI+2J7CgZ4YadulwLDa1WqH77eJw5CM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rIcm0KF1DXaoMgDbMO17rnP4TatPDFYrnZClqmhhbKjvnNJP7hGhvqPvXG+CEKo23 vB+CD7PLjJRp6nSXqwd7ZgLW28c8AU2bAlbT49CRBVWru5sVXQMhmbOpus4CAJxd+k fPLdsKgoJWNVuVXhiuuLSm4SJk5Ib83Bh9DPJtAM= Date: Fri, 11 Oct 2019 15:24:38 +0100 From: Will Deacon To: Matthias Maennich Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Jessica Yu , Masahiro Yamada , Martijn Coenen , Lucas De Marchi , Shaun Ruffell , Greg Kroah-Hartman , linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org Subject: Re: [PATCH 2/4] modpost: make updating the symbol namespace explict Message-ID: <20191011142437.ypdp7fni4jk43dnv@willie-the-truck> References: <20191010151443.7399-1-maennich@google.com> <20191010151443.7399-3-maennich@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010151443.7399-3-maennich@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: On Thu, Oct 10, 2019 at 04:14:41PM +0100, 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 > --- > 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); This changes the order wrt setting the namespace and sym_update_crc(), but that doesn't seem to matter, so: Acked-by: Will Deacon Will