linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [2.5-bk] Module loader compile bug
       [not found] <20021112050319.GA3651@paypal.com>
@ 2002-11-12 17:23 ` Rusty Russell
  2002-11-12 17:48   ` Paul Larson
  2002-11-13  2:13   ` Brad Heilbrun
  0 siblings, 2 replies; 3+ messages in thread
From: Rusty Russell @ 2002-11-12 17:23 UTC (permalink / raw)
  To: bheilbrun; +Cc: linux-kernel, torvalds

In message <20021112050319.GA3651@paypal.com> you write:
> I realize you're still working on this, but current bk is broken if
> you turn off module unload support. In include/linux/module.h we get:
> 
> 	#else /*!CONFIG_MODULE_UNLOAD*/
> <snip>
> 	#define symbol_put_addr(p) do { } while(0)
> 	
> 	#endif /* CONFIG_MODULE_UNLOAD */
> 	
> Which upsets this line in kernel/module.c 
> 
> 	  void symbol_put_addr(void *addr)
> 
> After the preprocessor gets a hold of it all, gcc doesn't know what to
> make of "void do { } while(0)".

Yep, symbol_put_addr() in module.c should be moved under __symbol_put.

Patch is fairly trivial, does this work for you?
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

--- working-2.5.47-module-alias/kernel/module.c.~1~	2002-11-12 22:10:43.000000000 +1100
+++ working-2.5.47-module-alias/kernel/module.c	2002-11-13 04:22:47.000000000 +1100
@@ -492,6 +492,28 @@ void __symbol_put(const char *symbol)
 }
 EXPORT_SYMBOL(__symbol_put);
 
+void symbol_put_addr(void *addr)
+{
+	struct kernel_symbol_group *ks;
+	unsigned long flags;
+
+	spin_lock_irqsave(&modlist_lock, flags);
+	list_for_each_entry(ks, &symbols, list) {
+ 		unsigned int i;
+
+		for (i = 0; i < ks->num_syms; i++) {
+			if (ks->syms[i].value == (unsigned long)addr) {
+				module_put(ks->owner);
+				spin_unlock_irqrestore(&modlist_lock, flags);
+				return;
+			}
+		}
+	}
+	spin_unlock_irqrestore(&modlist_lock, flags);
+	BUG();
+}
+EXPORT_SYMBOL_GPL(symbol_put_addr);
+
 #else /* !CONFIG_MODULE_UNLOAD */
 static void print_unload_info(struct seq_file *m, struct module *mod)
 {
@@ -716,28 +738,6 @@ void *__symbol_get(const char *symbol)
 }
 EXPORT_SYMBOL_GPL(__symbol_get);
 
-void symbol_put_addr(void *addr)
-{
-	struct kernel_symbol_group *ks;
-	unsigned long flags;
-
-	spin_lock_irqsave(&modlist_lock, flags);
-	list_for_each_entry(ks, &symbols, list) {
- 		unsigned int i;
-
-		for (i = 0; i < ks->num_syms; i++) {
-			if (ks->syms[i].value == (unsigned long)addr) {
-				module_put(ks->owner);
-				spin_unlock_irqrestore(&modlist_lock, flags);
-				return;
-			}
-		}
-	}
-	spin_unlock_irqrestore(&modlist_lock, flags);
-	BUG();
-}
-EXPORT_SYMBOL_GPL(symbol_put_addr);
-
 /* Transfer one ELF section to the correct (init or core) area. */
 static void *copy_section(const char *name,
 			  void *base,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.5-bk] Module loader compile bug
  2002-11-12 17:23 ` [2.5-bk] Module loader compile bug Rusty Russell
@ 2002-11-12 17:48   ` Paul Larson
  2002-11-13  2:13   ` Brad Heilbrun
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Larson @ 2002-11-12 17:48 UTC (permalink / raw)
  To: Rusty Russell; +Cc: bheilbrun, lkml, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On Tue, 2002-11-12 at 11:23, Rusty Russell wrote:
> Yep, symbol_put_addr() in module.c should be moved under __symbol_put.
> 
> Patch is fairly trivial, does this work for you?
> Rusty.
Fixed mine.  Only one minor thing, I still get a lot of warnings on:
include/linux/module.h:239: warning: `symbol_put' redefined

Thanks,
Paul Larson


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.5-bk] Module loader compile bug
  2002-11-12 17:23 ` [2.5-bk] Module loader compile bug Rusty Russell
  2002-11-12 17:48   ` Paul Larson
@ 2002-11-13  2:13   ` Brad Heilbrun
  1 sibling, 0 replies; 3+ messages in thread
From: Brad Heilbrun @ 2002-11-13  2:13 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, torvalds

On Wed, Nov 13, 2002 at 04:23:26AM +1100, Rusty Russell wrote:
> In message <20021112050319.GA3651@paypal.com> you write:
> > I realize you're still working on this, but current bk is broken if
> > you turn off module unload support. In include/linux/module.h we get:
> > 
> > 	#else /*!CONFIG_MODULE_UNLOAD*/
> > <snip>
> > 	#define symbol_put_addr(p) do { } while(0)
> > 	
> > 	#endif /* CONFIG_MODULE_UNLOAD */
> > 	
> > Which upsets this line in kernel/module.c 
> > 
> > 	  void symbol_put_addr(void *addr)
> > 
> > After the preprocessor gets a hold of it all, gcc doesn't know what to
> > make of "void do { } while(0)".
> 
> Yep, symbol_put_addr() in module.c should be moved under __symbol_put.
> 
> Patch is fairly trivial, does this work for you?

Yes, thanks.

-- 
Brad Heilbrun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-13  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20021112050319.GA3651@paypal.com>
2002-11-12 17:23 ` [2.5-bk] Module loader compile bug Rusty Russell
2002-11-12 17:48   ` Paul Larson
2002-11-13  2:13   ` Brad Heilbrun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).