Skip to contentSkip to conversation

binutils in debian unstable is broken.

DISCUSSION Josh McKinney 11 participants 12 messages Dec 5, 2001 – Dec 6, 2001

Subsystems (15)
lore
Share & tools
lore
#0 lore raw

This seems to be a kernel bug which is shown with the new version of ld. Thought I would forward this along so maybe it can get fixed.

Josh
----- Forwarded message from safemode <[email protected]> -----

Return-path: <[email protected]>
Delivery-date: Tue, 04 Dec 2001 01:03:50 -0500
X-Envelope-Sender: [email protected]
Subject: binutils in debian unstable is broken.
From: safemode <[email protected]>
To: [email protected]
Content-Transfer-Encoding: 7bit
X-Mailer: Evolution/0.99.2 (Preview Release)
Date: 04 Dec 2001 01:00:29 -0500
X-Mailing-List: <[email protected]> archive/latest/102306 Resent-Bcc:
Status: RO
X-Status: F
Content-Length: 1111
Lines: 31

binutils 2.11.92.0.12.3-1
has a problem compiling any 2.4.x kernel in recent history, ld specifically. Last version that did compile was along with gcc version gcc version 2.95.4 20011006 (Debian prerelease)

ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o

init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
mm/mm.o fs/fs.o ipc/ipc.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
drivers/net/net.o drivers/media/media.o drivers/ide/idedriver.o
drivers/pci/driver.o drivers/video/video.o \
        net/network.o \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux

drivers/char/char.o(.data+0x46b4): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

Signature · 12 lines
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]


----- End forwarded message -----

-- 
Linux, the choice                | Kites rise highest against the wind -- not 
of a GNU generation       -o)    | with it.   -- Winston Churchill 
Kernel 2.4.17pre2          /\    | 
on a i586                 _\_v   | 
                                 | 
#1 lore raw

Yep, but this seems to be a real PIA to catch. Different .configs trigger it differently and sometimes not at all. We're testing a couple patches at the moment.

Earlier I stated incorrectly that it is a binutils bug; sorry for misleading information. Instead it seems Debian sid's latest binutils package is much more strict.

---
Dan Chen [email protected]
GPG key: www.cs.unc.edu/~chenda/pubkey.gpg.asc

Quoted 2 lines · Josh McKinney

This seems to be a kernel bug which is shown with the new version of ld. Thought I would forward this along so maybe it can get fixed.

#2 lore raw
In reply to Josh McKinney
Quoted 7 lines · Josh McKinney

This seems to be a kernel bug which is shown with the new version of ld. Thought I would forward this along so maybe it can get fixed.

...
drivers/char/char.o(.data+0x46b4): undefined reference to `local symbols in discarded section .text.exit'

It is a kernel bug, and it's going to break a truckload of PCI drivers, along with uhci_pci_remove().

What is happening is this: a typical driver has:

static void __devexit remove_foo(...)
{}

static struct pci_driver foo_driver = {
	...
	remove: remove_foo;
};

The problem is that if foo.c is statically linked into the kernel, and if CONFIG_HOTPLUG is not set, __devexit evaluates to __exit. And in vmlinux.lds we've asked the linker to discard all the contents of section .text.exit.

The problem appears to be that the linker is now actually doing what we asked it to do, so the `remove_foo' entry in that table now points at a function which isn't going to be linked into the kernel. Oh dear.

Workarounds are:

1) Enable CONFIG_HOTPLUG

2) Change vmlinux.lds so we don't drop the .text.exit section (this is effectively the same as 1)

3) Something else. HJ's #ifdef MODULE works OK. It has a rather internecine relationship with the workings of __devexit though.

#3 lore raw
Quoted 3 lines

The problem appears to be that the linker is now actually doing what we asked it to do, so the `remove_foo' entry in that table now points at a function which isn't going to be linked into the kernel. Oh dear.

The ideal it seems would be for binutils to support passing a stub function to use in such cases. That would keep the kernel stuff working nicely and allow us to do panic("__exit code called"); if anyone actually did manage to call one.

#4 lore raw
Quoted 8 lines · Alan Cox
Quoted 3 lines

The problem appears to be that the linker is now actually doing what we asked it to do, so the `remove_foo' entry in that table now points at a function which isn't going to be linked into the kernel. Oh dear.

The ideal it seems would be for binutils to support passing a stub function to use in such cases. That would keep the kernel stuff working nicely and allow us to do panic("__exit code called"); if anyone actually did manage to call one.

We can get a panic() call (and remove the ugly #ifdef's) with something like this:

in some .h file:

#ifdef DEVEXIT_LINKED
#define DEVEXIT_FUNC(a) (a)
#else
void panic_exit_code();
#define DEVEXIT_FUNC(a) ((typeof((a)) *)panic_exit_code) #endif

in some .c file:

#ifndef DEVEXIT_LINKED
void panic_exit_code()
{
panic("__exit code called");
}
#endif

change the drivers like this:

#ifdef DEVEXIT_LINKED
remove: firestream_remove_one,
#endif

to this:

remove: DEVEXIT_FUNC(firestream_remove_one),

Eric

#5 lore raw
Quoted 9 lines · Eric Lammerts

change the drivers like this:

#ifdef DEVEXIT_LINKED
remove: firestream_remove_one,
#endif

to this:

remove: DEVEXIT_FUNC(firestream_remove_one),

The overall situation is not great, but I think I prefer this, or something like this, to the ifdef.

I'm tempted to say we should add a per-driver function that calls BUG() instead of a generic function which calls panic(), though. That will be a bit more informative to users. For the case where the real xxx_remove_one is dropped, it is a kernel bug if that code is -ever- called...

Jeff

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#6 lore raw
In reply to Eric Lammerts
Quoted 11 lines · Eric Lammerts

We can get a panic() call (and remove the ugly #ifdef's) with something like this:

in some .h file:

#ifdef DEVEXIT_LINKED
#define DEVEXIT_FUNC(a) (a)
#else
void panic_exit_code();
#define DEVEXIT_FUNC(a) ((typeof((a)) *)panic_exit_code) #endif

I definitely prefer this kind of encapsulation over #ifdef DEVEXIT_LINKED everywhere, it's still ugly, though.

However, I don't see much advantage of panic_exit_code() over a simple NULL. Actually, NULL will only oops, but not take the machine down, which makes it easier to catch and report the Oops. (Not everyone who's box crashes under X will setup a serial console).

--Kai

#7 lore raw
In reply to Andrew Morton
Quoted 8 lines · Alan Cox
Quoted 3 lines

The problem appears to be that the linker is now actually doing what we asked it to do, so the `remove_foo' entry in that table now points at a function which isn't going to be linked into the kernel. Oh dear.

The ideal it seems would be for binutils to support passing a stub function to use in such cases. That would keep the kernel stuff working nicely and allow us to do panic("__exit code called"); if anyone actually did manage to call one.

In binutils? This sounds more like kernel should do it...
If all .text.exit functions were not static, it would be pretty easy to do, but I guess they are usually static. In that case, I think it would take about 1 day hacking an libelf program, which would rewrite all object files which are going to be linked into vmlinux, which would add a new SHN_UND symbol to each .symtab/.strtab (say __devexit_called) and change all relocs against symbols in .text.exit sections to this symbol instead.
Maybe even it would take even less time, it is not that hard.

Jakub

#9 lore raw
In reply to Josh McKinney
Quoted 3 lines · Andrew Morton

3) Something else. HJ's #ifdef MODULE works OK. It has a rather internecine relationship with the workings of __devexit though.

OK, here's a piece of speed-editing. Fixed a few other __devexit bugs on the way as well.

I didn't touch ISDN - the __devexit handling there is a bit complex, and it needs a maintainer to go through it with the latest binutils. They need to test with CONFIG_HOTPLUG on and off, modular and static.

All the rest of the kernel is done. Could someone who has the new binutils installed please test?

For older kernels the easiest fix is to edit your platform's vmlinux.lds and just delete the /DISCARD/ section.

include/linux/init.h +12 -2
@@ -111,7 +111,7 @@ extern struct kernel_param __setup_start
  */
 #define module_exit(x)	__exitcall(x);
 
-#else
+#else	/* MODULE */
 
 #define __init
 #define __exit
@@ -141,7 +141,7 @@ typedef void (*__cleanup_module_func_t)(
 
 #define __setup(str,func) /* nothing */
 
-#endif
+#endif	/* MODULE */
 
 #ifdef CONFIG_HOTPLUG
 #define __devinit
@@ -153,6 +153,16 @@ typedef void (*__cleanup_module_func_t)(
 #define __devinitdata __initdata
 #define __devexit __exit
 #define __devexitdata __exitdata
+#endif
+
+/*
+ * DEVEXIT_LINKED is defined if sections marked __devexit will appear
+ * in the final kernel image.  If DEVEXIT_LINKED is not defined, the
+ * linker may end up removing __devexit sections, and so other sections
+ * are not allowed to refer to __devexit symbols.
+ */
+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
+#define DEVEXIT_LINKED
 #endif
 
 #endif /* _LINUX_INIT_H */
drivers/atm/eni.c +2 -0
@@ -2310,7 +2310,9 @@ static struct pci_driver eni_driver = {
 	name:		DEV_LABEL,
 	id_table:	eni_pci_tbl,
 	probe:		eni_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		eni_remove_one,
+#endif
 };
 
 
drivers/atm/firestream.c +3 -1
@@ -2102,7 +2102,9 @@ static struct pci_driver firestream_driv
 	name:           "firestream",
 	id_table:       firestream_pci_tbl,
 	probe:          firestream_init_one,
-	remove:         firestream_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove:		firestream_remove_one,
+#endif
 };
 
 static int __init firestream_init_module (void)
drivers/block/cciss.c +4 -2
@@ -2019,7 +2019,9 @@ static void __devexit cciss_remove_one (
 static struct pci_driver cciss_pci_driver = {
 	 name:   "cciss",
 	probe:  cciss_init_one,
-	remove:  cciss_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove:	cciss_remove_one,
+#endif
 	id_table:  cciss_pci_device_id, /* id_table */
 };
 
@@ -2046,7 +2048,7 @@ static int __init init_cciss_module(void
 	return ( cciss_init());
 }
 
-static void __exit cleanup_cciss_module(void)
+static void __devexit cleanup_cciss_module(void)
 {
 	int i;
 
drivers/char/joystick/cs461x.c +3 -1
@@ -313,7 +313,9 @@ static struct pci_driver cs461x_pci_driv
         name:           "PCI Gameport",
         id_table:       cs461x_pci_tbl,
         probe:          cs461x_pci_probe,
-        remove:         cs461x_pci_remove,
+#ifdef DEVEXIT_LINKED
+	remove: cs461x_pci_remove,
+#endif
 };
 
 int __init js_cs461x_init(void)
drivers/char/joystick/emu10k1-gp.c +3 -1
@@ -108,7 +108,9 @@ static struct pci_driver emu_driver = {
         name:           "Emu10k1 Gameport",
         id_table:       emu_tbl,
         probe:          emu_probe,
-        remove:         emu_remove,
+#ifdef DEVEXIT_LINKED
+	remove:		emu_remove,
+#endif
 };
 
 int __init emu_init(void)
drivers/char/joystick/pcigame.c +2 -0
@@ -180,7 +180,9 @@ static struct pci_driver pcigame_driver 
 	name:		"pcigame",
 	id_table:	pcigame_id_table,
 	probe:		pcigame_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		pcigame_remove,
+#endif
 };
 
 int __init pcigame_init(void)
drivers/char/serial.c +3 -1
@@ -4892,7 +4892,9 @@ MODULE_DEVICE_TABLE(pci, serial_pci_tbl)
 static struct pci_driver serial_pci_driver = {
        name:           "serial",
        probe:          serial_init_one,
-       remove:	       serial_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove:		serial_remove_one,
+#endif
        id_table:       serial_pci_tbl,
 };
 
drivers/char/sonypi.c +1 -1
@@ -685,7 +685,7 @@ static int __init sonypi_init_module(voi
 		return -ENODEV;
 }
 
-static void __exit sonypi_cleanup_module(void) {
+static void __devexit sonypi_cleanup_module(void) {
 	sonypi_remove();
 }
 
drivers/ieee1394/ohci1394.c +2 -0
@@ -2374,7 +2374,9 @@ static struct pci_driver ohci1394_driver
 	name:		OHCI1394_DRIVER_NAME,
 	id_table:	ohci1394_pci_tbl,
 	probe:		ohci1394_add_one,
+#ifdef DEVEXIT_LINKED
 	remove:		ohci1394_remove_one,
+#endif
 };
 
 static void __exit ohci1394_cleanup (void)
drivers/media/radio/radio-gemtek-pci.c +6 -4
@@ -421,10 +421,12 @@ static void __devexit gemtek_pci_remove(
 
 static struct pci_driver gemtek_pci_driver =
 {
-    name:	"gemtek_pci",
-id_table:	gemtek_pci_id,
-   probe:	gemtek_pci_probe,
-  remove:	gemtek_pci_remove
+	name:		"gemtek_pci",
+	id_table:	gemtek_pci_id,
+	probe:		gemtek_pci_probe,
+#ifdef DEVEXIT_LINKED
+	remove:		gemtek_pci_remove,
+#endif
 };
 
 static int __init gemtek_pci_init_module( void )
drivers/media/radio/radio-maxiradio.c +2 -0
@@ -376,7 +376,9 @@ static struct pci_driver maxiradio_drive
 	name:		"radio-maxiradio",
 	id_table:	maxiradio_pci_tbl,
 	probe:		maxiradio_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		maxiradio_remove_one,
+#endif
 };
 
 int __init maxiradio_radio_init(void)
drivers/media/video/bttv-driver.c +1 -1
@@ -2820,7 +2820,7 @@ static void bttv_irq(int irq, void *dev_
  *	Scan for a Bt848 card, request the irq and map the io memory 
  */
 
-static void __devexit bttv_remove(struct pci_dev *pci_dev)
+static void bttv_remove(struct pci_dev *pci_dev)
 {
         u8 command;
         int j;
drivers/media/video/meye.c +2 -0
@@ -1460,7 +1460,9 @@ static struct pci_driver meye_driver = {
 	name:		"meye",
 	id_table:	meye_pci_tbl,
 	probe:		meye_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		meye_remove,
+#endif
 };
 
 static int __init meye_init_module(void) {
drivers/net/3c59x.c +2 -0
@@ -2919,7 +2919,9 @@ static void __devexit vortex_remove_one 
 static struct pci_driver vortex_driver = {
 	name:		"3c59x",
 	probe:		vortex_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		vortex_remove_one,
+#endif
 	id_table:	vortex_pci_tbl,
 #ifdef CONFIG_PM
 	suspend:	vortex_suspend,
drivers/net/8139cp.c +2 -0
@@ -1313,7 +1313,9 @@ static struct pci_driver cp_driver = {
 	name:		DRV_NAME,
 	id_table:	cp_pci_tbl,
 	probe:		cp_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		cp_remove_one,
+#endif
 };
 
 static int __init cp_init (void)
drivers/net/8139too.c +2 -0
@@ -2493,7 +2493,9 @@ static struct pci_driver rtl8139_pci_dri
 	name:		DRV_NAME,
 	id_table:	rtl8139_pci_tbl,
 	probe:		rtl8139_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		rtl8139_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	rtl8139_suspend,
 	resume:		rtl8139_resume,
drivers/net/arcnet/com20020.c +1 -1
@@ -341,7 +341,7 @@ static void com20020_set_mc_list(struct 
 	}
 }
 
-void __devexit com20020_remove(struct net_device *dev)
+void com20020_remove(struct net_device *dev)
 {
 	unregister_netdev(dev);
 	free_irq(dev->irq, dev);
drivers/net/arcnet/com20020-pci.c +3 -1
@@ -160,7 +160,9 @@ static struct pci_driver com20020pci_dri
 	name:		"com20020",
 	id_table:	com20020pci_id_table,
 	probe:		com20020pci_probe,
-	remove:		com20020pci_remove
+#ifdef DEVEXIT_LINKED
+	remove:		com20020pci_remove,
+#endif
 };
 
 static int __init com20020pci_init(void)
drivers/net/defxx.c +4 -4
@@ -3333,7 +3333,7 @@ static void dfx_xmt_flush( DFX_board_t *
 	bp->cons_block_virt->xmt_rcv_data = prod_cons;
 	}
 
-static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
+static void dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
 {
 	DFX_board_t	  *bp = dev->priv;
 
@@ -3343,7 +3343,7 @@ static void __devexit dfx_remove_one_pci
 	kfree(dev);
 }
 
-static void __devexit dfx_remove_one (struct pci_dev *pdev)
+static void dfx_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
@@ -3368,7 +3368,7 @@ static int dfx_have_pci;
 static int dfx_have_eisa;
 
 
-static void __exit dfx_eisa_cleanup(void)
+static void dfx_eisa_cleanup(void)
 {
 	struct net_device *dev = root_dfx_eisa_dev;
 
@@ -3402,7 +3402,7 @@ static int __init dfx_init(void)
 	return ((rc_eisa < 0) ? 0 : rc_eisa)  + ((rc_pci < 0) ? 0 : rc_pci); 
 }
 
-static void __exit dfx_cleanup(void)
+static void dfx_cleanup(void)
 {
 	if (dfx_have_pci)
 		pci_unregister_driver(&dfx_driver);
drivers/net/dl2k.c +2 -0
@@ -1671,7 +1671,9 @@ static struct pci_driver rio_driver = {
 	name:"dl2k",
 	id_table:rio_pci_tbl,
 	probe:rio_probe1,
+#ifdef DEVEXIT_LINKED
 	remove:rio_remove1,
+#endif
 };
 
 static int __init
drivers/net/eepro100.c +2 -0
@@ -2281,7 +2281,9 @@ static struct pci_driver eepro100_driver
 	name:		"eepro100",
 	id_table:	eepro100_pci_tbl,
 	probe:		eepro100_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		eepro100_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	eepro100_suspend,
 	resume:		eepro100_resume,
drivers/net/epic100.c +2 -0
@@ -1507,7 +1507,9 @@ static struct pci_driver epic_driver = {
 	name:		DRV_NAME,
 	id_table:	epic_pci_tbl,
 	probe:		epic_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		epic_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	epic_suspend,
 	resume:		epic_resume,
drivers/net/fealnx.c +3 -1
@@ -1858,7 +1858,9 @@ static struct pci_driver fealnx_driver =
 	name:		"fealnx",
 	id_table:	fealnx_pci_tbl,
 	probe:		fealnx_init_one,
-	remove:		fealnx_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove: 	fealnx_remove_one,
+#endif
 };
 
 static int __init fealnx_init(void)
drivers/net/ioc3-eth.c +2 -0
@@ -1515,7 +1515,9 @@ static struct pci_driver ioc3_driver = {
 	name:		"ioc3-eth",
 	id_table:	ioc3_pci_tbl,
 	probe:		ioc3_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		ioc3_remove_one,
+#endif
 };
 
 static int __init ioc3_init_module(void)
drivers/net/irda/vlsi_ir.c +3 -1
@@ -1291,7 +1291,9 @@ static struct pci_driver vlsi_irda_drive
 	name:           drivername,
 	id_table:       vlsi_irda_table,
 	probe:          vlsi_irda_probe,
-	remove:         vlsi_irda_remove,
+#ifdef DEVEXIT_LINKED
+	remove:		vlsi_irda_remove,
+#endif
 	suspend:        vlsi_irda_suspend,
 	resume:         vlsi_irda_resume,
 };
drivers/net/natsemi.c +2 -0
@@ -2518,7 +2518,9 @@ static struct pci_driver natsemi_driver 
 	name:		DRV_NAME,
 	id_table:	natsemi_pci_tbl,
 	probe:		natsemi_probe1,
+#ifdef DEVEXIT_LINKED
 	remove:		natsemi_remove1,
+#endif
 #ifdef CONFIG_PM
 	suspend:	natsemi_suspend,
 	resume:		natsemi_resume,
drivers/net/ne2k-pci.c +2 -0
@@ -642,7 +642,9 @@ static void __devexit ne2k_pci_remove_on
 static struct pci_driver ne2k_driver = {
 	name:		DRV_NAME,
 	probe:		ne2k_pci_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		ne2k_pci_remove_one,
+#endif
 	id_table:	ne2k_pci_tbl,
 };
 
drivers/net/ns83820.c +2 -0
@@ -1455,7 +1455,9 @@ static struct pci_driver driver = {
 	name:		"ns83820",
 	id_table:	ns83820_pci_tbl,
 	probe:		ns83820_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		ns83820_remove_one,
+#endif
 #if 0	/* FIXME: implement */
 	suspend:	,
 	resume:		,
drivers/net/pci-skeleton.c +2 -0
@@ -1980,7 +1980,9 @@ static struct pci_driver netdrv_pci_driv
 	name:		MODNAME,
 	id_table:	netdrv_pci_tbl,
 	probe:		netdrv_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		netdrv_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	netdrv_suspend,
 	resume:		netdrv_resume,
drivers/net/pcmcia/xircom_cb.c +3 -1
@@ -170,7 +170,9 @@ static struct pci_driver xircom_ops = {
 	name:		"xircom_cb", 
 	id_table:	xircom_pci_table, 
 	probe:		xircom_probe, 
-	remove:		xircom_remove, 
+#ifdef DEVEXIT_LINKED
+	remove:		xircom_remove,
+#endif
 };
 
 
drivers/net/pcmcia/xircom_tulip_cb.c +2 -0
@@ -1748,7 +1748,9 @@ static struct pci_driver xircom_driver =
 	name:		DRV_NAME,
 	id_table:	xircom_pci_table,
 	probe:		xircom_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		xircom_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	xircom_suspend,
 	resume:		xircom_resume
drivers/net/sis900.c +2 -0
@@ -2098,7 +2098,9 @@ static struct pci_driver sis900_pci_driv
 	name:		SIS900_MODULE_NAME,
 	id_table:	sis900_pci_tbl,
 	probe:		sis900_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		sis900_remove,
+#endif
 };
 
 static int __init sis900_init_module(void)
drivers/net/starfire.c +2 -0
@@ -1963,7 +1963,9 @@ static void __devexit starfire_remove_on
 static struct pci_driver starfire_driver = {
 	name:		DRV_NAME,
 	probe:		starfire_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		starfire_remove_one,
+#endif
 	id_table:	starfire_pci_tbl,
 };
 
drivers/net/sundance.c +2 -0
@@ -1474,7 +1474,9 @@ static struct pci_driver sundance_driver
 	name:		DRV_NAME,
 	id_table:	sundance_pci_tbl,
 	probe:		sundance_probe1,
+#ifdef DEVEXIT_LINKED
 	remove:		sundance_remove1,
+#endif
 };
 
 static int __init sundance_init(void)
drivers/net/sungem.c +2 -0
@@ -2140,7 +2140,9 @@ static struct pci_driver gem_driver = {
 	name:		GEM_MODULE_NAME,
 	id_table:	gem_pci_tbl,
 	probe:		gem_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		gem_remove_one,
+#endif
 };
 
 static int __init gem_init(void)
drivers/net/tlan.c +3 -1
@@ -430,7 +430,9 @@ static struct pci_driver tlan_driver = {
 	name:		"tlan",
 	id_table:	tlan_pci_tbl,
 	probe:		tlan_init_one,
-	remove:		tlan_remove_one,	
+#ifdef DEVEXIT_LINKED
+	remove:		tlan_remove_one,
+#endif
 };
 
 static int __init tlan_probe(void)
drivers/net/tokenring/lanstreamer.c +2 -0
@@ -1812,7 +1812,9 @@ static struct pci_driver streamer_pci_dr
   name:       "lanstreamer",
   id_table:   streamer_pci_tbl,
   probe:      streamer_init_one,
+#ifdef DEVEXIT_LINKED
   remove:     streamer_remove_one,
+#endif
 };
 
 static int __init streamer_init_module(void) {
drivers/net/tokenring/olympic.c +3 -1
@@ -1705,7 +1705,9 @@ static struct pci_driver olympic_driver 
 	name:		"olympic",
 	id_table:	olympic_pci_tbl,
 	probe:		olympic_probe,
-	remove:		olympic_remove_one
+#ifdef DEVEXIT_LINKED
+    remove: olympic_remove_one,
+#endif
 };
 
 static int __init olympic_pci_init(void) 
drivers/net/tulip/tulip_core.c +2 -0
@@ -1889,7 +1889,9 @@ static struct pci_driver tulip_driver = 
 	name:		DRV_NAME,
 	id_table:	tulip_pci_tbl,
 	probe:		tulip_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		tulip_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	tulip_suspend,
 	resume:		tulip_resume,
drivers/net/via-rhine.c +2 -0
@@ -1667,7 +1667,9 @@ static struct pci_driver via_rhine_drive
 	name:		"via-rhine",
 	id_table:	via_rhine_pci_tbl,
 	probe:		via_rhine_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		via_rhine_remove_one,
+#endif
 };
 
 
drivers/net/wan/farsync.c +3 -1
@@ -1810,7 +1810,9 @@ static struct pci_driver fst_driver = {
         name:           FST_NAME,
         id_table:       fst_pci_dev_id,
         probe:          fst_add_one,
-        remove:         fst_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove:		fst_remove_one,
+#endif
         suspend:        NULL,
         resume:         NULL,
 };
drivers/net/winbond-840.c +2 -0
@@ -1697,7 +1697,9 @@ static struct pci_driver w840_driver = {
 	name:		DRV_NAME,
 	id_table:	w840_pci_tbl,
 	probe:		w840_probe1,
+#ifdef DEVEXIT_LINKED
 	remove:		w840_remove1,
+#endif
 #ifdef CONFIG_PM
 	suspend:	w840_suspend,
 	resume:		w840_resume,
drivers/net/wireless/airo.c +3 -1
@@ -64,7 +64,9 @@ static struct pci_driver airo_driver = {
 	name:     "airo",
 	id_table: card_ids,
 	probe:    airo_pci_probe,
-	remove:   airo_pci_remove,
+#ifdef DEVEXIT_LINKED
+	remove:	airo_pci_remove,
+#endif
 };
 #endif /* CONFIG_PCI */
 
drivers/net/wireless/orinoco_plx.c +2 -2
@@ -279,9 +279,9 @@ static struct pci_driver orinoco_plx_dri
 	name:"orinoco_plx",
 	id_table:orinoco_plx_pci_id_table,
 	probe:orinoco_plx_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:orinoco_plx_remove_one,
-	suspend:0,
-	resume:0
+#endif
 };
 
 static int __init orinoco_plx_init(void)
drivers/net/yellowfin.c +2 -0
@@ -1506,7 +1506,9 @@ static struct pci_driver yellowfin_drive
 	name:		DRV_NAME,
 	id_table:	yellowfin_pci_tbl,
 	probe:		yellowfin_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		yellowfin_remove_one,
+#endif
 };
 
 
drivers/parport/parport_serial.c +2 -0
@@ -331,7 +331,9 @@ static struct pci_driver parport_serial_
 	name:		"parport_serial",
 	id_table:	parport_serial_pci_tbl,
 	probe:		parport_serial_pci_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		parport_serial_pci_remove,
+#endif
 };
 
 
drivers/pcmcia/pci_socket.c +2 -0
@@ -249,7 +249,9 @@ static struct pci_driver pci_cardbus_dri
 	name:		"cardbus",
 	id_table:	cardbus_table,
 	probe:		cardbus_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		cardbus_remove,
+#endif
 	suspend:	cardbus_suspend,
 	resume:		cardbus_resume,
 };
drivers/sound/btaudio.c +3 -1
@@ -1030,7 +1030,9 @@ static struct pci_driver btaudio_pci_dri
         name:     "btaudio",
         id_table: btaudio_pci_tbl,
         probe:    btaudio_probe,
-        remove:   btaudio_remove,
+#ifdef DEVEXIT_LINKED
+	remove: btaudio_remove,
+#endif
 };
 
 int btaudio_init_module(void)
drivers/sound/emu10k1/main.c +2 -0
@@ -1127,7 +1127,9 @@ static struct pci_driver emu10k1_pci_dri
 	name:		"emu10k1",
 	id_table:	emu10k1_pci_tbl,
 	probe:		emu10k1_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		emu10k1_remove,
+#endif
 };
 
 static int __init emu10k1_init_module(void)
drivers/sound/ymfpci.c +3 -1
@@ -2547,7 +2547,9 @@ static struct pci_driver ymfpci_driver =
 	name:		"ymfpci",
 	id_table:	ymf_id_tbl,
 	probe:		ymf_probe_one,
-	remove:         ymf_remove_one,
+#ifdef DEVEXIT_LINKED
+	remove:		ymf_remove_one,
+#endif
 	suspend:	ymf_suspend,
 	resume:		ymf_resume
 };
drivers/usb/uhci.c +2 -0
@@ -2990,7 +2990,9 @@ static struct pci_driver uhci_pci_driver
 	id_table:	uhci_pci_ids,
 
 	probe:		uhci_pci_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		uhci_pci_remove,
+#endif
 
 #ifdef	CONFIG_PM
 	suspend:	uhci_pci_suspend,
drivers/usb/usb-ohci.c +2 -0
@@ -2860,7 +2860,9 @@ static struct pci_driver ohci_pci_driver
 	id_table:	&ohci_pci_ids [0],
 
 	probe:		ohci_pci_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		ohci_pci_remove,
+#endif
 
 #ifdef	CONFIG_PM
 	suspend:	ohci_pci_suspend,
drivers/usb/usb-uhci.c +1 -1
@@ -2845,7 +2845,7 @@ _static void start_hc (uhci_t *s)
 	s->running = 1;
 }
 
-_static void __devexit
+_static void
 uhci_pci_remove (struct pci_dev *dev)
 {
 	uhci_t *s = pci_get_drvdata(dev);
drivers/video/cyber2000fb.c +2 -0
@@ -1683,7 +1683,9 @@ static struct pci_device_id cyberpro_pci
 static struct pci_driver cyberpro_driver = {
 	name:		"CyberPro",
 	probe:		cyberpro_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		cyberpro_remove,
+#endif
 	suspend:	cyberpro_suspend,
 	resume:		cyberpro_resume,
 	id_table:	cyberpro_pci_table
drivers/video/imsttfb.c +2 -0
@@ -1643,7 +1643,9 @@ static struct pci_driver imsttfb_pci_dri
 	name:		"imsttfb",
 	id_table:	imsttfb_pci_tbl,
 	probe:		imsttfb_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		imsttfb_remove,
+#endif
 };
 
 static struct fb_ops imsttfb_ops = {
drivers/video/radeonfb.c +2 -0
@@ -619,7 +619,9 @@ static struct pci_driver radeonfb_driver
 	name:		"radeonfb",
 	id_table:	radeonfb_pci_table,
 	probe:		radeonfb_pci_register,
+#ifdef DEVEXIT_LINKED
 	remove:		radeonfb_pci_unregister,
+#endif
 };
 
 
drivers/video/riva/fbdev.c +2 -0
@@ -2082,7 +2082,9 @@ static struct pci_driver rivafb_driver =
 	name:		"rivafb",
 	id_table:	rivafb_pci_tbl,
 	probe:		rivafb_init_one,
+#ifdef DEVEXIT_LINKED
 	remove:		rivafb_remove_one,
+#endif
 };
 
 
drivers/video/tdfxfb.c +2 -0
@@ -495,7 +495,9 @@ static struct pci_driver tdfxfb_driver =
 	name:		"tdfxfb",
 	id_table:	tdfxfb_id_table,
 	probe:		tdfxfb_probe,
+#ifdef DEVEXIT_LINKED
 	remove:		tdfxfb_remove,
+#endif
 };
 
 MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);
#10 lore raw
In reply to Josh McKinney

Andrew Morton wrote:

[snip]

Quoted 2 lines

All the rest of the kernel is done. Could someone who has the new binutils installed please test?

All right, working for me!
It seems I was suffering from the same problem, see my other post (Bug report 2.4.16...) for details.

Thanks a lot!
(Rebooting now... Ahh, suicide squad :)

/Dantes

#11 lore raw
In reply to Josh McKinney
Quoted 8 lines · Andrew Morton
Quoted 3 lines · Andrew Morton

3) Something else. HJ's #ifdef MODULE works OK. It has a rather internecine relationship with the workings of __devexit though.

OK, here's a piece of speed-editing. Fixed a few other __devexit bugs on the way as well.

Thanks Andrew, you fixed it before I had the compulsion to compile a new kernel.

I'm running 2.4.17-pre2+ext3-0.9.16+binutils now, and all is well so far.

Mike