Bug 499 - error linking kernel, cs4232_pnp_remove
Summary: error linking kernel, cs4232_pnp_remove
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: Bugme Janitors Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-25 08:02 UTC by Burton Windle
Modified: 2003-04-10 08:27 UTC (History)
0 users

See Also:
Kernel Version: 2.5.66-bk1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Burton Windle 2003-03-25 08:02:34 UTC
Distribution: Debian Testing
Hardware Environment: single x86 CPU
Software Environment: 
Linux razor 2.5.65-bk5 #13 Mon Mar 24 10:05:27 EST 2003 i686 Pentium II 
(Klamath) GenuineIntel GNU/Linux

Gnu C                  2.95.4
Gnu make               3.80
util-linux             2.11y
mount                  2.11y
module-init-tools      implemented
e2fsprogs              1.32
reiserfsprogs          3.6.3
Linux C Library        2.3.1
Dynamic linker (ldd)   2.3.1
Procps                 3.1.6
Net-tools              1.60
Console-tools          0.2.3
Sh-utils               4.5.2

CONFIG_SOUND_GAMEPORT=y
CONFIG_SOUND=y
CONFIG_SOUND_PRIME=y
CONFIG_SOUND_OSS=y
CONFIG_SOUND_CS4232=y


Problem Description:
   ld -m elf_i386  -r -o init/built-in.o init/main.o init/version.o 
init/mounts.o init/initramfs.o
        ld -m elf_i386  -T arch/i386/vmlinux.lds.s arch/i386/kernel/head.o 
arch/i386/kernel/init_task.o   init/built-in.o --start-group  usr/built-in.o  
arch/i386/kernel/built-in.o  arch/i386/mm/built-in.o  arch/i386/mach-
default/built-in.o  kernel/built-in.o  mm/built-in.o  fs/built-in.o  ipc/built-
in.o  security/built-in.o  crypto/built-in.o  lib/lib.a  arch/i386/lib/lib.a  
drivers/built-in.o  sound/built-in.o  arch/i386/pci/built-in.o  net/built-in.o -
-end-group  -o .tmp_vmlinux1
sound/built-in.o(.text+0xdf33): In function `cs4232_pnp_remove':
: undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1

The last kernel I built was 2.5.56-bk5.. it built and linked fine.

There were many changes to the sound/oss/cs4232.c file in the 2.5.66 patch.
Comment 1 Burton Windle 2003-03-25 09:26:55 UTC
razor:/giant/linux# ./reference_discarded.pl
Finding objects, 655 objects, ignoring 0 module(s)
Finding conglomerates, ignoring 78 conglomerate(s)
Scanning objects
Error: ./sound/oss/cs4232.o .text refers to 00000113 
R_386_PC32        .exit.text
Done
Comment 2 Burton Windle 2003-03-25 14:22:42 UTC
Date: Tue, 25 Mar 2003 23:11:32 +0100
From: Daniel Ritz <daniel.ritz@gmx.ch>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, bwindle-kbt@fint.org
Subject: [PATCH 2.5] fix OSS cs4232 linking when compiled-in

hi

this patch fixes the linking of sound/oss/cs4232.c.
unload_cs4232 can't be __exit since it's called from cs_4232_pnp_remove
which isn't __exit.

against 2.5.66-bk. please apply.
[fixes bugzilla.kernel.org #499]

rgds
-daniel


===== sound/oss/cs4232.c 1.10 vs edited =====
--- 1.10/sound/oss/cs4232.c     Wed Feb 26 11:52:04 2003
+++ edited/sound/oss/cs4232.c   Tue Mar 25 22:55:07 2003
@@ -313,7 +313,7 @@
        }
 }

-static void __exit unload_cs4232(struct address_info *hw_config)
+static void unload_cs4232(struct address_info *hw_config)
 {
        int base = hw_config->io_base, irq = hw_config->irq;
        int dma1 = hw_config->dma, dma2 = hw_config->dma2;
Comment 3 Adam Belay 2003-04-08 16:42:46 UTC
Alternatively, we could also do this.  Any objections?

Thanks,
Adam

--- a/sound/oss/cs4232.c	2003-03-24 22:00:48.000000000 +0000
+++ b/sound/oss/cs4232.c	2003-04-08 19:44:57.000000000 +0000
@@ -406,7 +406,7 @@
 
 MODULE_DEVICE_TABLE(pnp, cs4232_pnp_table);
 
-static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id
*dev_id)
+static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct
pnp_device_id *dev_id)
 {
 	struct address_info *isapnpcfg;
 
@@ -428,7 +428,7 @@
 	return 0;
 }
 
-static void cs4232_pnp_remove(struct pnp_dev *dev)
+static void __exit cs4232_pnp_remove(struct pnp_dev *dev)
 {
 	struct address_info *cfg = pnp_get_drvdata(dev);
 	if (cfg) {
@@ -441,7 +441,7 @@
 	.name		= "cs4232",
 	.id_table	= cs4232_pnp_table,
 	.probe		= cs4232_pnp_probe,
-	.remove		= cs4232_pnp_remove,
+	.remove		= __exit_p(cs4232_pnp_remove),
 };
 
 static int __init init_cs4232(void)
Comment 4 Burton Windle 2003-04-10 08:27:41 UTC
Fixed as of 2.5.67-bk2 (Thanks Alan Cox! :) )

Note You need to log in before you can comment on or make changes to this bug.