Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp695274ybp; Fri, 4 Oct 2019 03:32:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdB11uOym9MBfJRQFy4iWaigf6iF+YBhShf/y0X1A+5tr8J5L9J5C4TErbrkkCLc3wDfS8 X-Received: by 2002:a50:908c:: with SMTP id c12mr14650211eda.45.1570185169527; Fri, 04 Oct 2019 03:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570185169; cv=none; d=google.com; s=arc-20160816; b=z6Rl0moyc4CpstUrBTz5b0g2V/5GE6g6rO1gU0SQRd0zKxsqzBGo8+VE6Z4qHYEOd0 yPjR4WvLTSW+eQh3aTpeL7I08FOY9Nl6sw5W0QQ3YcBildPNcXTiuLSZmf7OWe1zXcAx 4GqCdfzHSN3bkdNxukEByHsATPufgl7zUdvTJyCF6KiLeAhuAJe2Ps9tOJXQM/wqjwI8 NaWyFkMVVukr3FbUy1g++V32r6o2L8U2wfttuhHxD/q9prnpfxu/W27WZu+x3jlTLhxx HVBkK06tKHN5ePgNE/i2WQx5zYrbG87///1bvGCMmquX7wQ9c6xiM0uKf0JECHx+//S5 uFeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=1/VpF4gesFXU4507UWxnVqQ50T2yMtX0vj1yZbNb6oQ=; b=iEOB1nqt/fhkawzAHSLiwbHtGabVrh0ffCYkfKh6YpDkTSO5GaMGySMBdn01fu9XMz XZiVPQa8XwjvJUppYb8+yojbzKMBkrTUbFLFQ+IfbF69Zs2hUZhLox30oQ1K/DEcuGTe cuXh0dzgrT/2Ulyhh6HNQGOcnjCbiimW43FDmrs/ppTeWB8YxdKsqVZDmGdSe88sPP5e UTk23tKT4pfUOGMtdz0gmW57nkiBGkZJur3qOx6e2juyjeo2276qzfblebFkPbBNzFA1 i7PMMZi9WfqOYpb6EGCr2xYLe0ozOMUMOn8DYlk3GHBnOhKtTJEonmaowOVevqUPtaIL 9guQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EjXCs01N; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz19si2702462ejb.93.2019.10.04.03.32.25; Fri, 04 Oct 2019 03:32:49 -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=@google.com header.s=20161025 header.b=EjXCs01N; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388376AbfJDJ54 (ORCPT + 99 others); Fri, 4 Oct 2019 05:57:56 -0400 Received: from mail-qt1-f202.google.com ([209.85.160.202]:57234 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387423AbfJDJ5z (ORCPT ); Fri, 4 Oct 2019 05:57:55 -0400 Received: by mail-qt1-f202.google.com with SMTP id m6so5866609qtk.23 for ; Fri, 04 Oct 2019 02:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=1/VpF4gesFXU4507UWxnVqQ50T2yMtX0vj1yZbNb6oQ=; b=EjXCs01Nw9e85QbwhhT2J7CTEZu2WaD0wE4BqfUUDVzVWVU028VQ8BTERUBxKdYCud MA243tqwxNN5ZMv+MijBP/HwGQn1TDDQR82nDKo0OxslMQ/vn9mde3VL2uRXgW2Qdo8D vzdH7lDcznW/2FXUsmgMYlytbjNXeOSZrb6jAO6euFMwnM73Bwgq+upRy3G0qgF8yZCO B+VHFwgykCM4yR1WymcI/HBJtLVJDtakY1wEi4K34lpkRnT1jgogUopWcBZitko8fIij QuREfON3rxVDSqjhMQhBc8d/7Qdy4qH9pntPhSx2KfLkBbaJkODzpTLMq2iBs9NWO3qu NHSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=1/VpF4gesFXU4507UWxnVqQ50T2yMtX0vj1yZbNb6oQ=; b=oIT0rnGMv3Wb0k0OpoJRzG7xcEOEg9UdiyxWTBzE2cNYKq/jrZtTGZMY4FcFhIxtx9 HcgbGutUBTpsOcWysLUXv0rxkRsQwoIawrSrEbdrKfs3EYcMqjMI8fHe2C95apc5Sv5B XuAW3D4hetxlpcwS8uL/zT1BKV33PZm4JZpY5kCN8h1KWf4Bd26WH+6kwU+iqP6JqWvw g5U4mtxOV9J9+nQhk4i7t36xT8oo5jjyGQpbpS2URbbUyMpnStAmiEeXoWTxB4pQE2H9 v4Z8r6k3j7N4JlbpIoP16OsqlC5FvQMuwxx/tJ10EUY4YUY9+MwEeOoe87TB4EYgYOoL ByDw== X-Gm-Message-State: APjAAAVO9laQOMXZgZjDFUBV3tH20kIcAsmgLm1L/zZG8CpjebCfk+cP 0678AViagFyGJgCtq1DM3MHCo35/9U/YDRkpkbUBBDalHv3Z00aA1UHrv3SMTKQCSrPbXShJ9es FMHbe3s4UV2IskkKelEH949m+abiHziVMtGLdkOzdqJwXzL6AmM8acVpgBs1TusJK7snIBO4dQT o= X-Received: by 2002:a37:8f02:: with SMTP id r2mr9282685qkd.197.1570183073090; Fri, 04 Oct 2019 02:57:53 -0700 (PDT) Date: Fri, 4 Oct 2019 10:57:48 +0100 In-Reply-To: <20190917231031.81341-1-maennich@google.com> Message-Id: <20191004095748.223119-1-maennich@google.com> Mime-Version: 1.0 References: <20190917231031.81341-1-maennich@google.com> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog Subject: [PATCH] depmod: create and use System.map.no_namespaces From: Matthias Maennich To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, maennich@google.com, Stefan Wahren , Masahiro Yamada , Lucas De Marchi , Jessica Yu , Martijn Coenen , Greg Kroah-Hartman , linux-modules@vger.kernel.org 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 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/ 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 + +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