All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] fix non-modular ftape compile
@ 2003-09-25 10:23 Adrian Bunk
  2003-09-25 10:38 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2003-09-25 10:23 UTC (permalink / raw)
  To: linux-kernel

I got the following link error in 2.60-test5-mm4 (but it doesn't seem 
to be specific to -mm):

<--  snip  -->

...
  LD      .tmp_vmlinux1
drivers/built-in.o(.exit.text+0xfe6): In function `ftape_exit':
: undefined reference to `ftape_proc_destroy'
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

ftape_proc_destroy is only available #ifdef MODULE, the following patch 
fixes the link error:

--- linux-2.6.0-test5-mm4-no-smp-2.95/drivers/char/ftape/lowlevel/ftape-init.c.old	2003-09-23 00:58:02.000000000 +0200
+++ linux-2.6.0-test5-mm4-no-smp-2.95/drivers/char/ftape/lowlevel/ftape-init.c	2003-09-23 00:58:25.000000000 +0200
@@ -148,7 +148,7 @@
 {
 	TRACE_FUN(ft_t_flow);
 
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS)
+#if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS) && defined(MODULE)
 	ftape_proc_destroy();
 #endif
 	(void)ftape_set_nr_buffers(0);


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] fix non-modular ftape compile
  2003-09-25 10:23 [2.6 patch] fix non-modular ftape compile Adrian Bunk
@ 2003-09-25 10:38 ` Christoph Hellwig
  2003-09-25 11:03   ` Adrian Bunk
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2003-09-25 10:38 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Thu, Sep 25, 2003 at 12:23:09PM +0200, Adrian Bunk wrote:
> ftape_proc_destroy is only available #ifdef MODULE, the following patch 
> fixes the link error:

I'd suggest to kill the #ifdef MODULE instead and mark it __exit.
Same result but less ifdef crap..


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

* Re: [2.6 patch] fix non-modular ftape compile
  2003-09-25 10:38 ` Christoph Hellwig
@ 2003-09-25 11:03   ` Adrian Bunk
  2003-09-25 11:19     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2003-09-25 11:03 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel

On Thu, Sep 25, 2003 at 11:38:16AM +0100, Christoph Hellwig wrote:
> On Thu, Sep 25, 2003 at 12:23:09PM +0200, Adrian Bunk wrote:
> > ftape_proc_destroy is only available #ifdef MODULE, the following patch 
> > fixes the link error:
> 
> I'd suggest to kill the #ifdef MODULE instead and mark it __exit.
> Same result but less ifdef crap..


It increases the kernel size since in 2.6 __exit functions are discarded 
at runtime and not at link time.


Anyway, I agree with your suggestion. The following patch works instead 
of the first patch I sent.


--- linux-2.6.0-test5-mm4-no-smp-2.95/drivers/char/ftape/lowlevel/ftape-proc.c.old	2003-09-25 12:46:18.000000000 +0200
+++ linux-2.6.0-test5-mm4-no-smp-2.95/drivers/char/ftape/lowlevel/ftape-proc.c	2003-09-25 12:46:50.000000000 +0200
@@ -207,11 +207,9 @@
 		ftape_read_proc, NULL) != NULL;
 }
 
-#ifdef MODULE
-void ftape_proc_destroy(void)
+void __exit ftape_proc_destroy(void)
 {
 	remove_proc_entry("ftape", &proc_root);
 }
-#endif
 
 #endif /* defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS) */


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] fix non-modular ftape compile
  2003-09-25 11:03   ` Adrian Bunk
@ 2003-09-25 11:19     ` Christoph Hellwig
  2003-09-25 11:30       ` Adrian Bunk
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2003-09-25 11:19 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Christoph Hellwig, linux-kernel

On Thu, Sep 25, 2003 at 01:03:25PM +0200, Adrian Bunk wrote:
> It increases the kernel size since in 2.6 __exit functions are discarded 
> at runtime and not at link time.

Oh.  That sounds silly.  Do you remember who changed it and why?


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

* Re: [2.6 patch] fix non-modular ftape compile
  2003-09-25 11:19     ` Christoph Hellwig
@ 2003-09-25 11:30       ` Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2003-09-25 11:30 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel

On Thu, Sep 25, 2003 at 12:19:13PM +0100, Christoph Hellwig wrote:
> On Thu, Sep 25, 2003 at 01:03:25PM +0200, Adrian Bunk wrote:
> > It increases the kernel size since in 2.6 __exit functions are discarded 
> > at runtime and not at link time.
> 
> Oh.  That sounds silly.  Do you remember who changed it and why?

Andi Kleen changed it, it was needed for .altinstructions .

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

end of thread, other threads:[~2003-09-25 11:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-25 10:23 [2.6 patch] fix non-modular ftape compile Adrian Bunk
2003-09-25 10:38 ` Christoph Hellwig
2003-09-25 11:03   ` Adrian Bunk
2003-09-25 11:19     ` Christoph Hellwig
2003-09-25 11:30       ` Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.