From: Jeff Garzik <jgarzik@pobox.com>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: Bill Davidsen <davidsen@tmr.com>,
Linux-Kernel <linux-kernel@vger.kernel.org>,
"Randy.Dunlap" <rddunlap@osdl.org>
Subject: [PATCH] Re: [BUG]2.5.49-ac1 - more info on make error
Date: Mon, 02 Dec 2002 13:32:18 -0500 [thread overview]
Message-ID: <3DEBA732.7000906@pobox.com> (raw)
In-Reply-To: <20021202182213.GC775@fs.tum.de>
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
Adrian Bunk wrote:
> On Wed, Nov 27, 2002 at 03:45:24PM -0500, Bill Davidsen wrote:
> ./drivers/net/tulip/de2104x.o(.data+0x74): undefined reference to `local
> symbols in discarded section .exit.text'
>
>
> In drivers/net/tulip/de2104x.c the function de_remove_on is __exit but
> the pointer to it is __devexit_p.
>
> Two possible solutions:
>
> 1. Make this driver hot-pluggable. Jeff Garzik vetoes against this
> solution.
>
> 2. Change the __devexit_p to an #ifdef MODULE (it's ugly, but it lets
> the driver compiles with all combinations of config options without
> making it hot-pluggable):
As noted in the #warning, solution 3 (__exit_p) is the preferred one ;-)
Bill Irwin wrote up the patch to fix things The Right Way(tm). The
attached patch from Bill should eliminate all compile errors and warnings.
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2172 bytes --]
This patch fixes tulip up by doing the following things:
(1) add __exit_p() to <linux/init.h>
(2) add the unused attributed to __exit routines for non-modules
(3) use __exit_p() to refer to de_remove_one()
(4) remove redundant timer initialization preceding variable initialization
drivers/net/tulip/de2104x.c | 4 +---
include/linux/init.h | 13 ++++++++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
--- linux-2.5.49-mm1/include/linux/init.h Fri Nov 22 13:40:14 2002
+++ linux-2.5.49-mm2/include/linux/init.h Wed Nov 27 15:32:17 2002
@@ -42,10 +42,15 @@
discard it in modules) */
#define __init __attribute__ ((__section__ (".init.text")))
#define __initdata __attribute__ ((__section__ (".init.data")))
-#define __exit __attribute__ ((__section__(".exit.text")))
#define __exitdata __attribute__ ((__section__(".exit.data")))
#define __exit_call __attribute__ ((unused,__section__ (".exitcall.exit")))
+#ifdef MODULE
+#define __exit __attribute__ ((__section__(".exit.text")))
+#else
+#define __exit __attribute__ ((unused,__section__(".exit.text")))
+#endif
+
/* For assembly routines */
#define __INIT .section ".init.text","ax"
#define __FINIT .previous
@@ -199,6 +204,12 @@ extern struct kernel_param __setup_start
#define __devexit_p(x) x
#else
#define __devexit_p(x) NULL
+#endif
+
+#ifdef MODULE
+#define __exit_p(x) x
+#else
+#define __exit_p(x) NULL
#endif
#endif /* _LINUX_INIT_H */
--- linux-2.5.49-mm1/drivers/net/tulip/de2104x.c Fri Nov 22 13:40:56 2002
+++ linux-2.5.49-mm2/drivers/net/tulip/de2104x.c Wed Nov 27 14:31:11 2002
@@ -2014,7 +2014,6 @@ static int __init de_init_one (struct pc
dev->watchdog_timeo = TX_TIMEOUT;
dev->irq = pdev->irq;
- init_timer(&de->media_timer);
de = dev->priv;
de->de21040 = ent->driver_data == 0 ? 1 : 0;
@@ -2217,8 +2216,7 @@ static struct pci_driver de_driver = {
.name = DRV_NAME,
.id_table = de_pci_tbl,
.probe = de_init_one,
-#warning only here to fix build. should be __exit_p not __devexit_p.
- .remove = __devexit_p(de_remove_one),
+ .remove = __exit_p(de_remove_one),
#ifdef CONFIG_PM
.suspend = de_suspend,
.resume = de_resume,
next prev parent reply other threads:[~2002-12-02 18:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-27 20:45 [BUG]2.5.49-ac1 - more info on make error Bill Davidsen
2002-12-02 17:06 ` Randy.Dunlap
2002-12-02 19:02 ` Bill Davidsen
2002-12-02 19:05 ` Randy.Dunlap
2002-12-02 19:52 ` Bill Davidsen
2002-12-02 18:22 ` Adrian Bunk
2002-12-02 18:32 ` Jeff Garzik [this message]
2002-12-02 19:44 ` Bill Davidsen
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=3DEBA732.7000906@pobox.com \
--to=jgarzik@pobox.com \
--cc=bunk@fs.tum.de \
--cc=davidsen@tmr.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.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 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.