Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1608861imm; Wed, 8 Aug 2018 22:00:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz+BMn/xP8umCyZ3fz8xGrOy+CyC+PrrXH1YRO2/zgs48MRUtjUT1kCXHCtnlFZ3A3zPvqX X-Received: by 2002:a63:8b44:: with SMTP id j65-v6mr621186pge.248.1533790836389; Wed, 08 Aug 2018 22:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533790836; cv=none; d=google.com; s=arc-20160816; b=TVm9t48OtCTuljqmyAIUQGzX4l4SjaRTvl3Jj7zTa0wm0RxkvZOFh94V23o60uUmz6 e+ayLIJhHQhDydCpmi3z3H+4t7ixuQdoctKsMvcr0v/frZ3IfI5pIUP9fghTKm6eKVDc ButGUNo2zmsmAjYyUeALI/phX3ZuIWn0iGuSNWNqW7pqAeibmLv3D+UiNNkA69fs5yag YQ+xFz29YXBvJRB5QnaDbbQ4qXuS6+ZNfRd3rErDX4Hww3d5CglRoovunWHjcZGGGfUv GJz92kziABW8hPtaX/EPQTAN5Sh6NbyWfkAZucxZVzYul7Qy9w2sVDKrXLYkL/aOQF8H WkAQ== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=owH3HWjesSxYMSqoSGCl6iBo93VGPyPraRGtvmxSaU0=; b=dJ2k8zQjYGQizbc/UGfWV112bsn7iAT/jX5S2x7760GPZcNK2lSqQZi4wKfj9YXTKd dnVNYxtYLQ2V4yo9OwZuSHZedccGvU6R1SBqhMKzNK89B4g3g2SecUY75BgnbWKdKxH5 UFNcPMyMcJ/FJskdHpWTPBB/oPp8QPdFk7puZ1F3BbfXOWhp0gbYPCx9igChjeJXMEA0 bzn228GeEKMAZQhTA81TXrgbukteZ6RIIuUAdeE9N1XtmYrCpCqLDYoDQC6hPUGaF3dj /I+VNtX0mONvWx+ViRcot6W5th1cygGtaa/HWdfmB74oOpfFNPkApgQIh+oo3c11sJpy QJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=V7vZvFkw; 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 a5-v6si5450099pll.412.2018.08.08.22.00.21; Wed, 08 Aug 2018 22:00:36 -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=V7vZvFkw; 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 S1728153AbeHIHW3 (ORCPT + 99 others); Thu, 9 Aug 2018 03:22:29 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:28926 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeHIHW3 (ORCPT ); Thu, 9 Aug 2018 03:22:29 -0400 Received: from mail-ua0-f172.google.com (mail-ua0-f172.google.com [209.85.217.172]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w794xLh1029064; Thu, 9 Aug 2018 13:59:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w794xLh1029064 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1533790762; bh=owH3HWjesSxYMSqoSGCl6iBo93VGPyPraRGtvmxSaU0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=V7vZvFkwUYjAoqXUJzue69w7iWEYWOgnbe1r61MhHmNLKGb4qCi+Raxq2hP2fawMO uc8GDEoVWoybaiRL5tNSCpLoJgerEA9PSMmzK0hTdKu8x5/881eZr5raQhJtSlGPy+ ecoCSfZzI4/+XHP/Lps0OQRfSaFCgxOroIR+KuV90Qw6NpVwJq30gDnezs/KYVq/e8 pM2QGsItTA5D1OSn057gM0Slp1fQVeQFWevxusADp5ohKs+ldD4SyM5sEzU933Vh/e R4QeRu0gYE7hodCv98zzM8j97Ced1w4eIUnsm29HVVdTgsXz2yfUKcdDwmH1xkwNx6 8fK42c5zFArag== X-Nifty-SrcIP: [209.85.217.172] Received: by mail-ua0-f172.google.com with SMTP id i4-v6so4956410uak.0; Wed, 08 Aug 2018 21:59:22 -0700 (PDT) X-Gm-Message-State: AOUpUlHYCvV+OhbYNrMvLOjUyRhfD/gXskIM0l40Gci3BRi3QemI5bF/ MrJo+7YlfrtDhMjeJIUS0L/bfxF5H6zEfH5IJpg= X-Received: by 2002:a1f:5f44:: with SMTP id t65-v6mr328785vkb.135.1533790761341; Wed, 08 Aug 2018 21:59:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 21:58:40 -0700 (PDT) In-Reply-To: References: From: Masahiro Yamada Date: Thu, 9 Aug 2018 13:58:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: add Map option to save vmlinux linker map file(s) To: Vasily Gorbik Cc: Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list 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 2018-08-06 22:38 GMT+09:00 Vasily Gorbik : > Add "Map" kbuild option, so that "make Map=1" would save vmlinux linker > map into vmlinux.map, which is quite useful during making kernel changes > related to how the kernel is composed. > > KBUILD_SAVE_LINK_MAP flag is exported and architectures > supporting compressed kernel images might respect it and produce > arch/*/boot/compressed/vmlinux.map for the decompressor code as well. > > Signed-off-by: Vasily Gorbik > --- If the map file is quite useful, should it be generated all the time? Or, how about CONFIG option if you want this conditionally generated? I do not want to increase fine-grained command-line switches except _really_ useful ones. > .gitignore | 1 + > Makefile | 14 ++++++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/.gitignore b/.gitignore > index 97ba6b79834c..1d2308e597ad 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -44,6 +44,7 @@ > *.xz > Module.symvers > modules.builtin > +vmlinux.map > > # > # Top-level generic files > diff --git a/Makefile b/Makefile > index 7a3c4548162b..f1790deae03b 100644 > --- a/Makefile > +++ b/Makefile > @@ -176,6 +176,14 @@ ifndef KBUILD_CHECKSRC > KBUILD_CHECKSRC = 0 > endif > > +# Use 'make Map=1' to enable saving linker map file(s): > +# vmlinux.map for vmlinux, > +# (arch/*/boot/compressed/vmlinux.map for arch/*/boot/compressed/vmlinux) > + > +ifeq ("$(origin Map)", "command line") > + export KBUILD_SAVE_LINK_MAP := $(Map) > +endif > + > # Use make M=dir to specify directory of external module to build > # Old syntax make ... SUBDIRS=$PWD is still supported > # Setting the environment variable KBUILD_EXTMOD take precedence > @@ -838,6 +846,11 @@ ifeq ($(CONFIG_STRIP_ASM_SYMS),y) > LDFLAGS_vmlinux += $(call ld-option, -X,) > endif > > +ifdef KBUILD_SAVE_LINK_MAP > +LDFLAGS_vmlinux += -Map=vmlinux.map > +CLEAN_FILES += vmlinux.map > +endif > + > # insure the checker run with the right endianness > CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian) > > @@ -1434,6 +1447,7 @@ help: > @echo ' 2: warnings which occur quite often but may still be relevant' > @echo ' 3: more obscure warnings, can most likely be ignored' > @echo ' Multiple levels can be combined with W=12 or W=123' > + @echo ' make Map=1 [targets] Save vmlinux linker map file(s)' > @echo '' > @echo 'Execute "make" or "make all" to build all targets marked with [*] ' > @echo 'For further info see the ./README file' > -- > 2.18.0.13.gd42ae10 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Masahiro Yamada