Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10076689ybi; Wed, 10 Jul 2019 23:04:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPggRKbB2m8FtQcuqJkdgYx6gbxABF6073hGw6XUuR9pvIAeyC37x5ok7NiOBWE06TFwyz X-Received: by 2002:a17:902:a413:: with SMTP id p19mr2693768plq.134.1562825069092; Wed, 10 Jul 2019 23:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562825069; cv=none; d=google.com; s=arc-20160816; b=lYgaWdlyUn8uhLbgibVQXa4ilxben3luQJcln4FqzqHoP1NczedsxS3LghOO33HjCG j2vwHpiOtBRiQpmZ/5ekDJ5a6SwNV7DjwwiZcDCI/tJC9/mSFT2tgfDdL70XmPDuFdIx M8IeieIIAetSYACERM3IzKB5tmODmjxIWidLPI7w3QrQC4Mb4UEStJLNktvshvHm6oJs pfNJHp2hXGsklxMSCVpijzZPo6Uty1SYyFKn2nqGlyE5T7P0ARKIqqlCaCcPM1/yathz DzWhIdwcJUAHkJXpCC+w6uTMLRkO3wHsc45Z5gkrNLsSyo4lQbosPX1ebvuP6u+aBY0/ idOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=iZRH/pqcP+K+A+neVC6JVPL+Vc4UBQc7CTbEdrMj1B8=; b=oEtP12KU/VmbKCC4tb/Pti72G4Wppa1DCuX8GNlkCDPiG5bPccifvDBLpmCp3afzP4 9WYatjA2lOir2eIU5Kn4I8luQkE8U9RiodFxbMAaQcPAluBQInsYiJwBEpWL3Spu07iD 2GlADxVXXYqQGsofmsedhTiplGxIiGxao5xy3AFbsFt7m158hM/TmTpEbZNQWc97dWZR AbUlX9B0nKvNQxsb0P2Gv/nsm0UjArqKduZTlnBFFCo0xF2mORro6aZh8WRcU1YTDXv2 xA+tMzDpxculZM8qUG2TPybr8lixK80imAHjy1CpxAzCqfWltvdsQU8z7hFmfS7hE8f/ 4VvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mlVGsQwY; 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 k22si4304375pfi.289.2019.07.10.23.04.11; Wed, 10 Jul 2019 23:04:29 -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=mlVGsQwY; 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 S1728118AbfGKFp7 (ORCPT + 99 others); Thu, 11 Jul 2019 01:45:59 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:59467 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfGKFpx (ORCPT ); Thu, 11 Jul 2019 01:45:53 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x6B5ip8T031345; Thu, 11 Jul 2019 14:44:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x6B5ip8T031345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562823898; bh=iZRH/pqcP+K+A+neVC6JVPL+Vc4UBQc7CTbEdrMj1B8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlVGsQwYQrxJg90PTLm52mBuqGweoB+CPzQbf6QvCV0ZUtIl7a1bvZOTnzt0sQLcp f8fDC1/p3uD+3JlI93ZJO4w0J6r9cr3seTLJtkxha//rjK2bEAfwKlwerAkkO63T0J yEX+3+VMFdAeVAPazEHvof9Oa419QX6AZLYWwLS2qohjske8vaxATuhSGVvR+aSTWr RCTQrAeTGVh5/3UWqR4h8DOH0Ji/UQHwLVeifXEZ4ZmcMC1LN99D9LwbivpQ+sH7Cc +hOpKqz7+QXkHs/O8vXHyRllYVdjVORSLCkP6DNygPTN9tSeRXDkudZUd1WUOqOqet anh8tFjYBKNzw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 09/11] kbuild: remove the first line of *.mod files Date: Thu, 11 Jul 2019 14:44:32 +0900 Message-Id: <20190711054434.1177-10-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190711054434.1177-1-yamada.masahiro@socionext.com> References: <20190711054434.1177-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current format of *.mod is like this: line 1: directory path to the .ko file line 2: a list of objects linked into this module line 3: unresolved symbols (only when CONFIG_TRIM_UNUSED_KSYMS=y) Now that *.mod and *.ko are created in the same directory, the line 1 provides no valuable information. It can be derived by replacing the extension .mod with .ko. Cut the first line. Signed-off-by: Masahiro Yamada --- Changes in v2: None scripts/Makefile.build | 4 ++-- scripts/adjust_autoksyms.sh | 2 +- scripts/mod/sumversion.c | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9fb30633acd2..2709646b1a5d 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -279,7 +279,7 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) - @{ echo $(@:.o=.ko); echo $@; \ + @{ echo $@; \ $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) quiet_cmd_cc_lst_c = MKLST $@ @@ -461,7 +461,7 @@ cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis $(multi-used-m): FORCE $(call if_changed,link_multi-m) - @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ + @{ echo $(filter %.o,$^); \ $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) $(call multi_depend, $(multi-used-m), .o, -objs -y -m) diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 8b44bb80a451..89871cae3954 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -48,7 +48,7 @@ cat > "$new_ksyms_file" << EOT EOT sed 's/ko$/mod/' modules.order | -xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- | +xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | sort -u | sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 166f3fa247a9..63062024ce0e 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -398,7 +398,7 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) char *sources, *end, *fname; char filelist[PATH_MAX + 1]; - /* objects for a module are listed in the second line of *.mod file. */ + /* objects for a module are listed in the first line of *.mod file. */ snprintf(filelist, sizeof(filelist), "%.*smod", (int)strlen(modname) - 1, modname); @@ -407,13 +407,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) /* not a module or .mod file missing - ignore */ return; - sources = strchr(file, '\n'); - if (!sources) { - warn("malformed versions file for %s\n", modname); - goto release; - } + sources = file; - sources++; end = strchr(sources, '\n'); if (!end) { warn("bad ending versions file for %s\n", modname); -- 2.17.1