mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: David Brownell <david-b@pacbell.net>
Cc: "Adam J. Richter" <adam@yggdrasil.com>,
	greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Module alias and table support
Date: Fri, 29 Nov 2002 12:28:57 +1100	[thread overview]
Message-ID: <20021129013010.485E12C2E3@lists.samba.org> (raw)
In-Reply-To: Your message of "Wed, 27 Nov 2002 22:44:24 -0800." <3DE5BB48.5090606@pacbell.net>

In message <3DE5BB48.5090606@pacbell.net> you write:
> Rusty Russell wrote:
> > In message <3DE53EF6.4080303@pacbell.net> you write:
> > 
> >>One of the points being that the breakage comes from changing the
> >>format supported by modutils.  Restoring current functionality should
> >>IMO be high on the agenda .... USB has worked poorly in normal .configs
> >>for a while now, because of this.
> > 
> > 
> > Absolutely.  I sent the patch to put the USB etc. tables back in
> > (merged in .48 IIRC).
> 
> Hmm, with 2.5.50 and module-init-tools 0.8a two "modules.*map" files
> are created -- but they're empty.  That's with the latest 2.5 modutils
> 
>    http://www.kernel.org/pub/linux/kernel/people/rusty/modules/
> 
> So that's not quite working yet.

Yes, there's a patch in the NEWS file, which is referred to at the top
of the README file.  Did you apply it?  If not, apply the one below
(which doesn't delete the #include <linux/elf.h>, which broke
CONFIG_KALLSYMS=y).

Hope this helps!
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Module Table Support for module-init-tools depmod
Author: Rusty Russell
Status: Tested on 2.5.50

D: This patch adds a "__mod_XXX_table" symbol which is an alias to the
D: module table, rather than a pointer.  This makes it relatively
D: trivial to extract the table.  Previously, it required a pointer
D: dereference, which means the relocations must be applied, which is
D: why the old depmod needs so much of modutils (ie. it basically
D: links the whole module in order to find the table).
D:
D: The old depmod can still be invoked using "-F System.map" to
D: generate the tables (there'll be lots of other warnings, and it
D: will generate a completely bogus modules.dep, but the tables should
D: be OK.)

diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.50/include/linux/module.h working-2.5.50-table/include/linux/module.h
--- linux-2.5.50/include/linux/module.h	Mon Nov 25 08:44:18 2002
+++ working-2.5.50-table/include/linux/module.h	Thu Nov 28 10:59:39 2002
@@ -14,6 +14,7 @@
 #include <linux/cache.h>
 #include <linux/kmod.h>
 #include <linux/elf.h>
+#include <linux/stringify.h>
 
 #include <asm/module.h>
 #include <asm/uaccess.h> /* For struct exception_table_entry */
@@ -40,11 +40,14 @@ struct kernel_symbol
 
 #ifdef MODULE
 
-#define MODULE_GENERIC_TABLE(gtype,name)	\
-static const unsigned long __module_##gtype##_size \
-  __attribute__ ((unused)) = sizeof(struct gtype##_id); \
-static const struct gtype##_id * __module_##gtype##_table \
-  __attribute__ ((unused)) = name
+/* For replacement modutils, use an alias not a pointer. */
+#define MODULE_GENERIC_TABLE(gtype,name)			\
+static const unsigned long __module_##gtype##_size		\
+  __attribute__ ((unused)) = sizeof(struct gtype##_id);		\
+static const struct gtype##_id * __module_##gtype##_table	\
+  __attribute__ ((unused)) = name;				\
+extern const struct gtype##_id __mod_##gtype##_table		\
+  __attribute__ ((unused, alias(__stringify(name))))
 
 /* This is magically filled in by the linker, but THIS_MODULE must be
    a constant so it works in initializers. */

  parent reply	other threads:[~2002-11-29  1:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-27 20:54 Adam J. Richter
2002-11-27 21:53 ` David Brownell
     [not found]   ` <20021127142006.A24246@adam.yggdrasil.com>
2002-11-27 22:59     ` David Brownell
2002-11-28 23:39       ` Rusty Russell
2002-11-28  3:14   ` Rusty Russell
2002-11-28  6:44     ` David Brownell
2002-11-28 22:01       ` David Brownell
2002-11-29  3:26         ` Rusty Russell
2002-11-29 19:56           ` Gerd Knorr
2002-11-29  1:28       ` Rusty Russell [this message]
2002-11-29  3:40     ` Greg KH
2002-11-27 22:40 ` 2.5 modutils getting back device " David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2002-11-28  0:22 [PATCH] Module alias and " Adam J. Richter
2002-11-28  1:48 ` David Brownell
2002-11-28  4:45 ` Keith Owens
2002-11-27  6:25 David Brownell
2002-11-26  4:52 Adam J. Richter
2002-11-26  3:26 Adam J. Richter
2002-11-26  3:49 ` Greg KH
2002-11-14  1:19 Rusty Russell
2002-11-20  8:23 ` Greg KH
2002-11-24 23:34   ` Rusty Russell
2002-11-25 21:36     ` Greg KH
2002-11-25 23:42       ` Rusty Russell

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=20021129013010.485E12C2E3@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=adam@yggdrasil.com \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.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

Powered by JetHome