Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1234540ybp; Fri, 4 Oct 2019 11:27:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLdWntZhMd+oWtaP/YmHNS+sStGdbFN6iGQr36KfTMWEXPph0zQtWw24rggapM4rHkTW/W X-Received: by 2002:a50:d6db:: with SMTP id l27mr17022939edj.164.1570213665873; Fri, 04 Oct 2019 11:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570213665; cv=none; d=google.com; s=arc-20160816; b=BIiJprpOPbaiPVVoKJ1v1zVxNOtNSruT7yclIQUjWy4QCmnfer/tyna8QMy/fmeygo gkO17haP9ZhccfKWpzG30OLTWSe5hUbavRs6VFnSrhmoO0luMyzAiW5UGJHv3LASYd4b pPZI+YFCXkAQvwQrn5wTCi4n3ZFFcPHmzBuA1r7seQEoW2L80ncDMNbMGxH6QGxTDrP4 APTr9S6JrjmS6J+hlq7R7KCFkKcKwCby1cAyIbbQ/LVwIF8hVvnes6e/97iCrZDgb1Lq 7A6e/R+Sf1H+0JqZypnklEoKZEFCmuWCxCpBTri10mkIEGBRhIi/bLweYxstD9XTl3yG tWFg== 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; bh=EG4uhXwG5jrCbKoCifB7aoh41j2vEgUP8k3d/Yoz+3Y=; b=PhJsp16flkUTcVgcXabSOjHHJwZ1WQYqXawJYyZ3jnM8i+cmcueQ92pGAbExOj1waD Gv+ZAHUGc/oxS0n/5djhHxcU3xjF+oijAmdERcl2bia9QjOdBMVum+te436NAjkctcc+ KVUWgOCrTjhpB0apBzjPiUHxl7Q243Ij4eUECqw8EtG+OuqXumJaXgOegQo8YcEu+8uD UtX/PGIAIQhI9INhtSe2SlHgqkGen77E4ySAw8S2UfS72m5ftlP/ZVtJhnhvoFcYZ4Zi DrAYQg7T4NOXDxd47JP1sYGN0RKT87cTfjJ8a5TcLAdukDichA7xEj992S7YFFgV9o85 ulCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lR58Eu0k; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si3449378ejk.20.2019.10.04.11.27.21; Fri, 04 Oct 2019 11:27:45 -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=@gmail.com header.s=20161025 header.b=lR58Eu0k; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730594AbfJDSZs (ORCPT + 99 others); Fri, 4 Oct 2019 14:25:48 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51086 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730090AbfJDSZs (ORCPT ); Fri, 4 Oct 2019 14:25:48 -0400 Received: by mail-wm1-f67.google.com with SMTP id 5so6784613wmg.0; Fri, 04 Oct 2019 11:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EG4uhXwG5jrCbKoCifB7aoh41j2vEgUP8k3d/Yoz+3Y=; b=lR58Eu0k+JCfeIPEyEs/Ht4+UJtMI73bNG8K4mnf3RvCQUUmORvgI1pKfa/CtHvFfn Of9B+zQV5JIn3I+Ebz89qa5I0gdhExzuuBKrMcdHmPyHcG/IP/7W9ckKZZ7iJGeNiwLg aXlJ9moTioW6My3A+l6QVfHGbOozq44HdiKLGMyPc3+xl3m8mpLPahJ2n5i4uF74nlNT CO/NMcJXFuynhCpQB7D0sqJU4zFJE07iMQrHhiYJVQ8N5gbsMlrQBQSrjd3P4qdsEOxP z//WZ6fg/XMPh2IwF50R7ahW9Z4Z/GQtwJguQ0/AQJUypt9z5LnLlkgh9srpV6sWZa8H iaEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EG4uhXwG5jrCbKoCifB7aoh41j2vEgUP8k3d/Yoz+3Y=; b=ElMgSrZsM1ocoEm4urTWxBU62gp2UwXLg+r8OhpHszv7GYv85ZHZD36x16g0JNZT7P OVaXTt6+J+ICMSRnKxkJnKUeGhP7nwqKHNLNYAHvFsRGGug7mgqf7VSBB4BxHS5hi9pq 3q+MIMIXRIn7jJyNZp/wMEMPfsboE0+Gixvn50O6BvBjgvYh6XA2UNZICG1Mt9OEG14K U11CBhkMcfXaz/hpDe31hXVkVoMLmv1g9kQspxGG9RQJM1PGHLFJQ8LSz5Qhm5N/YETK LZ3xnO9q7sd0+bmuwdticNDwNdHLgKQnd/RReuG1COfLY72oNkyhx5/HVhOhG5ZpOi8g 1/ow== X-Gm-Message-State: APjAAAWiIXlUS01H3cTIvenNt1MIXpzxoyaCd77nIknBI8tNp4+8wvOE ldtPErJrOnNJQzdH0h0yU5BKIvtAthT5khGuX4E= X-Received: by 2002:a05:600c:10cc:: with SMTP id l12mr11624477wmd.165.1570213545580; Fri, 04 Oct 2019 11:25:45 -0700 (PDT) MIME-Version: 1.0 References: <20190917231031.81341-1-maennich@google.com> <20191004095748.223119-1-maennich@google.com> In-Reply-To: <20191004095748.223119-1-maennich@google.com> From: Lucas De Marchi Date: Fri, 4 Oct 2019 11:25:33 -0700 Message-ID: Subject: Re: [PATCH] depmod: create and use System.map.no_namespaces To: Matthias Maennich Cc: lkml , kernel-team@android.com, Stefan Wahren , Masahiro Yamada , Jessica Yu , Martijn Coenen , Greg Kroah-Hartman , 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 4, 2019 at 2:57 AM Matthias Maennich wrote: > > depmod in its current version is not aware of symbol namespace in > ksymtab entries introduced with 8651ec01daed ("module: add support for > symbol namespaces."). They have the form > > __ksymtab_NAMESPACE.symbol_name > > A fix for kmod's depmod has been proposed [1]. In order to support older > versions of depmod as well, create a System.map.no_namespaces during > scripts/depmod.sh that has the pre-namespaces format. That way users do > not immediately upgrade the userspace tool. > > [1] https://lore.kernel.org/linux-modules/20191004094136.166621-1-maennich@google.com/ > > Reported-by: Stefan Wahren > Fixes: 8651ec01daed ("module: add support for symbol namespaces.") > Cc: Masahiro Yamada > Cc: Lucas De Marchi > Cc: Jessica Yu > Cc: Martijn Coenen > Cc: Greg Kroah-Hartman > Cc: linux-modules@vger.kernel.org > Signed-off-by: Matthias Maennich > --- > > Please note this depends on the new ksymtab entry format proposed in > https://lore.kernel.org/lkml/20191003075826.7478-2-yamada.masahiro@socionext.com/ I don't really agree with that thought, more below. > > That is likely to be merged soon as well as it fixes problems in 5.4-rc*, hence > this patch depends on it. > > Cheers, > Matthias > > .gitignore | 1 + > scripts/depmod.sh | 8 +++++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/.gitignore b/.gitignore > index 70580bdd352c..5ed58a7cb433 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -59,6 +59,7 @@ modules.order > /vmlinux-gdb.py > /vmlinuz > /System.map > +/System.map.no_namespaces > /Module.markers > /modules.builtin.modinfo > > diff --git a/scripts/depmod.sh b/scripts/depmod.sh > index e083bcae343f..602e1af072c7 100755 > --- a/scripts/depmod.sh > +++ b/scripts/depmod.sh > @@ -39,7 +39,13 @@ if $depmod_hack_needed; then > KERNELRELEASE=99.98.$KERNELRELEASE > fi > > -set -- -ae -F System.map > +# Older versions of depmod do not support symbol namespaces in ksymtab entries, > +# hence create an alternative System.map with namespace patched out to use for > +# depmod. I.e. transform entries as follows: > +# __ksymtab_NAMESPACE.symbol_name -> __ksymtab_symbol_name > +sed 's/__ksymtab_.*\./__ksymtab_/' System.map > System.map.no_namespaces So people with old kmod will have to know they need to pass System.map.no_namespaces rather than the usual System.map. Also, distros will need to be update to also copy the new file to the kernel package (or upgrade/patch kmod). I'd rather maintain the current format and fix the bug that patch is fixing. The namespace in the end IMO is just a small annoyance with a reason to exist. Lucas De Marchi > + > +set -- -ae -F System.map.no_namespaces > if test -n "$INSTALL_MOD_PATH"; then > set -- "$@" -b "$INSTALL_MOD_PATH" > fi > -- > 2.23.0.581.g78d2f28ef7-goog > -- Lucas De Marchi