1 Index: linux-2.6.31.5/include/asm-generic/vmlinux.lds.h
2 ===================================================================
3 --- linux-2.6.31.5.orig/include/asm-generic/vmlinux.lds.h 2009-10-23 00:57:56.000000000 +0200
4 +++ linux-2.6.31.5/include/asm-generic/vmlinux.lds.h 2009-10-23 12:43:50.000000000 +0200
9 +#ifndef SYMTAB_KEEP_STR
10 +#define SYMTAB_KEEP_STR *(__ksymtab_strings.*)
11 +#define SYMTAB_DISCARD_STR
13 +#define SYMTAB_DISCARD_STR *(__ksymtab_strings.*)
17 +#define SYMTAB_KEEP *(__ksymtab.*)
18 +#define SYMTAB_DISCARD
20 +#define SYMTAB_DISCARD *(__ksymtab.*)
23 +#ifndef SYMTAB_KEEP_GPL
24 +#define SYMTAB_KEEP_GPL *(__ksymtab_gpl.*)
25 +#define SYMTAB_DISCARD_GPL
27 +#define SYMTAB_DISCARD_GPL *(__ksymtab_gpl.*)
30 #ifndef VMLINUX_SYMBOL
31 #define VMLINUX_SYMBOL(_sym_) _sym_
34 /* Kernel symbol table: Normal symbols */ \
35 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
36 VMLINUX_SYMBOL(__start___ksymtab) = .; \
39 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
42 /* Kernel symbol table: GPL-only symbols */ \
43 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
44 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
47 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
50 /* Kernel symbol table: Normal unused symbols */ \
51 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
52 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
53 - *(__ksymtab_unused) \
54 + *(__ksymtab_unused.*) \
55 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
58 /* Kernel symbol table: GPL-only unused symbols */ \
59 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
60 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
61 - *(__ksymtab_unused_gpl) \
62 + *(__ksymtab_unused_gpl.*) \
63 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
66 /* Kernel symbol table: GPL-future-only symbols */ \
67 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
68 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
69 - *(__ksymtab_gpl_future) \
70 + *(__ksymtab_gpl_future.*) \
71 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
76 /* Kernel symbol table: strings */ \
77 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
78 - *(__ksymtab_strings) \
84 + SYMTAB_DISCARD_GPL \
85 + SYMTAB_DISCARD_STR \
88 /* __*init sections */ \
89 Index: linux-2.6.31.5/include/linux/module.h
90 ===================================================================
91 --- linux-2.6.31.5.orig/include/linux/module.h 2009-10-23 00:57:56.000000000 +0200
92 +++ linux-2.6.31.5/include/linux/module.h 2009-10-23 12:43:50.000000000 +0200
94 #define __CRC_SYMBOL(sym, sec)
98 +#define __EXPORT_SUFFIX(sym)
100 +#define __EXPORT_SUFFIX(sym) "." #sym
103 /* For every exported symbol, place a struct in the __ksymtab section */
104 #define __EXPORT_SYMBOL(sym, sec) \
105 extern typeof(sym) sym; \
106 __CRC_SYMBOL(sym, sec) \
107 static const char __kstrtab_##sym[] \
108 - __attribute__((section("__ksymtab_strings"), aligned(1))) \
109 + __attribute__((section("__ksymtab_strings" \
110 + __EXPORT_SUFFIX(sym)), aligned(1))) \
111 = MODULE_SYMBOL_PREFIX #sym; \
112 static const struct kernel_symbol __ksymtab_##sym \
114 - __attribute__((section("__ksymtab" sec), unused)) \
115 + __attribute__((section("__ksymtab" sec \
116 + __EXPORT_SUFFIX(sym)), unused)) \
117 = { (unsigned long)&sym, __kstrtab_##sym }
119 #define EXPORT_SYMBOL(sym) \
120 Index: linux-2.6.31.5/arch/arm/kernel/vmlinux.lds.S
121 ===================================================================
122 --- linux-2.6.31.5.orig/arch/arm/kernel/vmlinux.lds.S 2009-10-23 00:57:56.000000000 +0200
123 +++ linux-2.6.31.5/arch/arm/kernel/vmlinux.lds.S 2009-10-23 12:43:50.000000000 +0200
128 - /DISCARD/ : { /* Exit code and data */
132 - *(.ARM.exidx.exit.text)
133 - *(.ARM.extab.exit.text)
134 -#ifndef CONFIG_HOTPLUG_CPU
135 - *(.ARM.exidx.cpuexit.text)
136 - *(.ARM.extab.cpuexit.text)
138 -#ifndef CONFIG_HOTPLUG
139 - *(.ARM.exidx.devexit.text)
140 - *(.ARM.extab.devexit.text)
148 .text : { /* Real text segment */
149 _text = .; /* Text and read-only data */
150 __exception_text_start = .;
156 + /DISCARD/ : { /* Exit code and data */
161 + *(.ARM.exidx.exit.text)
162 + *(.ARM.extab.exit.text)
163 +#ifndef CONFIG_HOTPLUG_CPU
164 + *(.ARM.exidx.cpuexit.text)
165 + *(.ARM.extab.cpuexit.text)
167 +#ifndef CONFIG_HOTPLUG
168 + *(.ARM.exidx.devexit.text)
169 + *(.ARM.extab.devexit.text)
177 /* Stabs debugging sections. */
178 .stab 0 : { *(.stab) }
179 .stabstr 0 : { *(.stabstr) }
180 Index: linux-2.6.31.5/arch/powerpc/kernel/vmlinux.lds.S
181 ===================================================================
182 --- linux-2.6.31.5.orig/arch/powerpc/kernel/vmlinux.lds.S 2009-10-23 00:57:56.000000000 +0200
183 +++ linux-2.6.31.5/arch/powerpc/kernel/vmlinux.lds.S 2009-10-23 12:43:50.000000000 +0200
188 - /* Sections to be discarded. */
201 + /* Sections to be discarded. */
207 . = ALIGN(PAGE_SIZE);