Skip to contentSkip to conversation

sparc64: fix section error in sparcspkr

PATCH Applied Sam Ravnborg 2 participants 2 messages Jan 21, 2008 – Jan 22, 2008 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: fix section error in sparcspkr

With a sparc64 defconfig modified to set CONFIG_HOTPLUG=n the following error happened during link of vmlinux:

local symbol 0: discarded in section .devexit.text' from drivers/built-in.o local symbol 1: discarded in section .devexit.text' from drivers/built-in.o

(The error message above is from kbuild.git but it happens in mainline too)

The error happens becase there is a reference from .text/.data to a function marked __devexit. With CONFIG_HOTPLUG=n all code marked __devexit are discarded and the linker complains.

It was tracked down to sparcspkr.c which were missing __devexit_p() around the function pointers.

Unfortunately modpost did not catch this since modpost do not warn about references from .data to .devexit from variables named *_driver.

---

drivers/input/misc/sparcspkr.c +2 -2
index a3637d8..fed3c37 100644
@@ -195,7 +195,7 @@ static struct of_platform_driver ebus_beep_driver = {
 	.name		= "beep",
 	.match_table	= ebus_beep_match,
 	.probe		= ebus_beep_probe,
-	.remove		= sparcspkr_remove,
+	.remove		= __devexit_p(sparcspkr_remove),
 	.shutdown	= sparcspkr_shutdown,
 };
 
@@ -236,7 +236,7 @@ static struct of_platform_driver isa_beep_driver = {
 	.name		= "beep",
 	.match_table	= isa_beep_match,
 	.probe		= isa_beep_probe,
-	.remove		= sparcspkr_remove,
+	.remove		= __devexit_p(sparcspkr_remove),
 	.shutdown	= sparcspkr_shutdown,
 };
 
Applied
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Mon, 21 Jan 2008 22:50:36 +0100

Quoted 12 lines

With a sparc64 defconfig modified to set CONFIG_HOTPLUG=n the following error happened during link of vmlinux:

local symbol 0: discarded in section .devexit.text' from drivers/built-in.o local symbol 1: discarded in section .devexit.text' from drivers/built-in.o

(The error message above is from kbuild.git but it happens in mainline too)

The error happens becase there is a reference from .text/.data to a function marked __devexit. With CONFIG_HOTPLUG=n all code marked __devexit are discarded and the linker complains.

Quoted 7 lines

It was tracked down to sparcspkr.c which were missing __devexit_p() around the function pointers.

Unfortunately modpost did not catch this since modpost do not warn about references from .data to .devexit from variables named *_driver.

Applied, thanks Sam.