mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Hansen <x@jeffhansen.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] [MODULES]: Add KBUILD_EXTSYMVERS to supply external Module.symvers files
Date: Fri, 3 Oct 2008 15:43:48 -0600 (MDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0810031542450.20293@ren> (raw)

Some out-of-tree modules require other out-of-tree modules to load and
function.  This patch allows one module to supply the path(s) of the
modules it depends on by setting the KBUILD_EXTSYMVERS make variable.
The Module.symvers files from these path(s) will be included when
searching for symbol versions, and the resulting modules will have
proper symbol version information.
---
  scripts/Makefile.modpost |    2 ++
  scripts/mod/modpost.c    |   10 ++++++----
  2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 9ee9783..a472d3c 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -81,6 +81,8 @@ modpost = scripts/mod/modpost                    \
   $(if $(CONFIG_MODVERSIONS),-m)                  \
   $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)       \
   $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)   \
+ $(if $(KBUILD_EXTSYMVERS),                      \
+   $(foreach dir,$(KBUILD_EXTSYMVERS),-i $(dir)/Module.symvers)) \
   $(if $(KBUILD_EXTMOD),-I $(modulesymfile))      \
   $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(EXTRA_SYMBOLS))) \
   $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8f038e6..37de1c3 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -39,6 +39,7 @@ enum export {
  };

  #define PRINTF __attribute__ ((format (printf, 1, 2)))
+#define MAX_SYMVERS 16

  PRINTF void fatal(const char *fmt, ...)
  {
@@ -2044,19 +2045,20 @@ int main(int argc, char **argv)
  {
  	struct module *mod;
  	struct buffer buf = { };
-	char *kernel_read = NULL, *module_read = NULL;
+	char *kernel_read[MAX_SYMVERS] = { 0 }, *module_read = NULL;
  	char *dump_write = NULL;
  	char *markers_read = NULL;
  	char *markers_write = NULL;
  	int opt;
  	int err;
+	int kernel_reads = 0;
  	struct ext_sym_list *extsym_iter;
  	struct ext_sym_list *extsym_start = NULL;

  	while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:")) != -1) {
  		switch (opt) {
  		case 'i':
-			kernel_read = optarg;
+			kernel_read[kernel_reads++] = optarg;
  			break;
  		case 'I':
  			module_read = optarg;
@@ -2102,8 +2104,8 @@ int main(int argc, char **argv)
  		}
  	}

-	if (kernel_read)
-		read_dump(kernel_read, 1);
+	while (kernel_reads > 0)
+		read_dump(kernel_read[--kernel_reads], 1);
  	if (module_read)
  		read_dump(module_read, 0);
  	while (extsym_start) {
-- 
1.5.6.4

---------------------------------------------------
"If someone's gotta do it, it might as well be me."
                 x@jeffhansen.com

                 reply	other threads:[~2008-10-03 21:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0810031542450.20293@ren \
    --to=x@jeffhansen.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®