Skip to contentSkip to conversation

.init.rodata and modpost adjustments

PATCH New Jan Beulich 1 participant 1 message Sep 5, 2008

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

PATCH 1/1 .init.rodata and modpost adjustments

- first of all, add .init.rodata to INIT_DATA
- second, add .init.rodata and .init.setup to modpost's ALL_INIT_DATA_SECTIONS
- third, generalize the pattern used by modpost's *INIT_SECTIONS and EXIT_SECTIONS, and use them for ALL_{INIT,EXIT}_SECTIONS
- fourth, warn about cross references between .cpuinit.* and .meminit.*+
- finally, put all __setup_str* symbols in .init.rodata (and mark them 'const')

---
 include/asm-generic/vmlinux.lds.h |    5 ++-
 include/linux/init.h              |    3 +-
 scripts/mod/modpost.c             |   50 +++++++++++++++++++++++++++++---------
 3 files changed, 44 insertions(+), 14 deletions(-)
include/asm-generic/vmlinux.lds.h +3 -2
@@ -264,10 +264,11 @@
 #define INIT_DATA							\
 	*(.init.data)							\
 	DEV_DISCARD(init.data)						\
-	DEV_DISCARD(init.rodata)					\
 	CPU_DISCARD(init.data)						\
-	CPU_DISCARD(init.rodata)					\
 	MEM_DISCARD(init.data)						\
+	*(.init.rodata)							\
+	DEV_DISCARD(init.rodata)					\
+	CPU_DISCARD(init.rodata)					\
 	MEM_DISCARD(init.rodata)
 
 #define INIT_TEXT							\
include/linux/init.h +2 -1
@@ -227,7 +227,8 @@ struct obs_kernel_param {
  * obs_kernel_param "array" too far apart in .init.setup.
  */
 #define __setup_param(str, unique_id, fn, early)			\
-	static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \
+	static const char __setup_str_##unique_id[] __initconst	\
+		__aligned(1) = str; \
 	static struct obs_kernel_param __setup_##unique_id	\
 		__used __section(.init.setup)			\
 		__attribute__((aligned((sizeof(long)))))	\
scripts/mod/modpost.c +39 -11

78 lines not on this page · raw message