Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp986716ybp; Fri, 11 Oct 2019 07:25:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAGpj9piSGszPCwnvKyjszVyUa7/Ay0sFiEaxgAbMpIeUR6X2CaDSWTqmATt80qMBaHkWP X-Received: by 2002:a17:906:48d4:: with SMTP id d20mr9309828ejt.246.1570803933295; Fri, 11 Oct 2019 07:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570803933; cv=none; d=google.com; s=arc-20160816; b=zM1BjhQyYWaMYLtwJgmdT7BCSbIrzIUGTMqoNqFy3yIHmC03tEIvhxMT4NSwK4KZF9 5d4wNXLGAHPDstLjU3XkpQJ4SBOKth1eyUfbOsbNn0EV8ci2zIepA7ePB4jZkyt5toGb 0vSf4DVaoVdqBHtEXffoy3PIh8knBfLsszpRL1+J2IRu5t9SvnKe77HknKxrqzlI37aM Iqk+3F9enExCe/b9tlaQP1GsxpbOiibdh996tErF9bOBFoXgGNObLVfbLQ98nJKTXD6W WNyMWvoTHVjCK70ygnpGPTfyXUWdtBjC5UTMVW1pR+W5K7R4AV9Y6niXEFi9cwHII2OE /mpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nXYe8NwdCrxpCehFJKbx56M9LOuhG5XbQ9RXvmwkjiU=; b=IZSCqbyqHhiTfS2q/83vo5vd86cTUMwAen9cU+tZdf+xPWszUlayibemN+qxvFiZQN zEClWES+gYO7uRQmBmEoLHczIhzDsUxx5JBy2ZoNNzNplSU8aCxDEPKPWgohwd5qm9Wf NYiSxyAHgh63LMLWtce3CV16H1f9bUTtm0lYXRS4UDXmF0USlfegtRAK9Ng6ARtrbFJZ ILWIdLJ8K6vPfQQhQwcZaOUXyer58bKwk+u6ki4RVDtf3ebVSaOJGrlNIabgvob0+FdV +BEwtcEJmiGJsrRxtW+8R9SjYE6ceyJYF3ddp9Z6f0hHzSZoDOrAUp35QWxD3zyHdErT J7bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rIcm0KF1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si5711105ejs.94.2019.10.11.07.25.09; Fri, 11 Oct 2019 07:25:33 -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=@kernel.org header.s=default header.b=rIcm0KF1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728679AbfJKOYo (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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