aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/spinlock.h3
-rw-r--r--scripts/Makefile.lib8
-rw-r--r--scripts/mod/modpost.c3
3 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 0e9682c9def5..799be6747944 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -59,8 +59,7 @@
59/* 59/*
60 * Must define these before including other files, inline functions need them 60 * Must define these before including other files, inline functions need them
61 */ 61 */
62#define LOCK_SECTION_NAME \ 62#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
63 ".text.lock." __stringify(KBUILD_BASENAME)
64 63
65#define LOCK_SECTION_START(extra) \ 64#define LOCK_SECTION_START(extra) \
66 ".subsection 1\n\t" \ 65 ".subsection 1\n\t" \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0f81dcfd6909..550798f57da5 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -81,8 +81,10 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
81# Note: It's possible that one object gets potentially linked into more 81# Note: It's possible that one object gets potentially linked into more
82# than one module. In that case KBUILD_MODNAME will be set to foo_bar, 82# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
83# where foo and bar are the name of the modules. 83# where foo and bar are the name of the modules.
84basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) 84name-fix = $(subst $(comma),_,$(subst -,_,$1))
85modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))) 85basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
86modname_flags = $(if $(filter 1,$(words $(modname))),\
87 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
86 88
87_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) 89_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
88_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) 90_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
@@ -113,7 +115,7 @@ endif
113 115
114c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ 116c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
115 $(__c_flags) $(modkern_cflags) \ 117 $(__c_flags) $(modkern_cflags) \
116 $(basename_flags) $(modname_flags) 118 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
117 119
118a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ 120a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
119 $(__a_flags) $(modkern_aflags) 121 $(__a_flags) $(modkern_aflags)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8ce5a6318684..f70ff13d4818 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -539,10 +539,9 @@ add_header(struct buffer *b, struct module *mod)
539 buf_printf(b, "\n"); 539 buf_printf(b, "\n");
540 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); 540 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
541 buf_printf(b, "\n"); 541 buf_printf(b, "\n");
542 buf_printf(b, "#undef unix\n"); /* We have a module called "unix" */
543 buf_printf(b, "struct module __this_module\n"); 542 buf_printf(b, "struct module __this_module\n");
544 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); 543 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
545 buf_printf(b, " .name = __stringify(KBUILD_MODNAME),\n"); 544 buf_printf(b, " .name = KBUILD_MODNAME,\n");
546 if (mod->has_init) 545 if (mod->has_init)
547 buf_printf(b, " .init = init_module,\n"); 546 buf_printf(b, " .init = init_module,\n");
548 if (mod->has_cleanup) 547 if (mod->has_cleanup)