aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 23:27:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 23:27:50 -0500
commitce6513f758b1852a2f24f76f07d0fae304d24ad3 (patch)
tree2186f8d1f4389734f5f6a4b20e448651edf57815 /scripts
parentd8fe4acc88da8fbbe360b6592c9d0abbb85117dc (diff)
parentb6568b1a19ad995221d1816c4fcdd116d9c33e42 (diff)
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell: "Mainly boring here, too. rmmod --wait finally removed, though" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: modpost: fix bogus 'exported twice' warnings. init: fix in-place parameter modification regression asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible kernel: add support for init_array constructors modpost: Optionally ignore secondary errors seen if a single module build fails module: remove rmmod --wait option.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.modpost4
-rw-r--r--scripts/mod/modpost.c22
2 files changed, 21 insertions, 5 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 8dcdca27d836..69f0a1417e9a 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -79,9 +79,11 @@ modpost = scripts/mod/modpost \
79 $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ 79 $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
80 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) 80 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
81 81
82MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS)))
83
82# We can go over command line length here, so be careful. 84# We can go over command line length here, so be careful.
83quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules 85quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
84 cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) -s -T - 86 cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T -
85 87
86PHONY += __modpost 88PHONY += __modpost
87__modpost: $(modules:.ko=.o) FORCE 89__modpost: $(modules:.ko=.o) FORCE
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index bfcea5d3b27d..17855761e6b7 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -17,6 +17,7 @@
17#include <string.h> 17#include <string.h>
18#include <limits.h> 18#include <limits.h>
19#include <stdbool.h> 19#include <stdbool.h>
20#include <errno.h>
20#include "modpost.h" 21#include "modpost.h"
21#include "../../include/generated/autoconf.h" 22#include "../../include/generated/autoconf.h"
22#include "../../include/linux/license.h" 23#include "../../include/linux/license.h"
@@ -37,6 +38,8 @@ static int warn_unresolved = 0;
37/* How a symbol is exported */ 38/* How a symbol is exported */
38static int sec_mismatch_count = 0; 39static int sec_mismatch_count = 0;
39static int sec_mismatch_verbose = 1; 40static int sec_mismatch_verbose = 1;
41/* ignore missing files */
42static int ignore_missing_files;
40 43
41enum export { 44enum export {
42 export_plain, export_unused, export_gpl, 45 export_plain, export_unused, export_gpl,
@@ -161,7 +164,7 @@ struct symbol {
161 unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */ 164 unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
162 unsigned int kernel:1; /* 1 if symbol is from kernel 165 unsigned int kernel:1; /* 1 if symbol is from kernel
163 * (only for external modules) **/ 166 * (only for external modules) **/
164 unsigned int preloaded:1; /* 1 if symbol from Module.symvers */ 167 unsigned int preloaded:1; /* 1 if symbol from Module.symvers, or crc */
165 enum export export; /* Type of export */ 168 enum export export; /* Type of export */
166 char name[0]; 169 char name[0];
167}; 170};
@@ -329,8 +332,11 @@ static void sym_update_crc(const char *name, struct module *mod,
329{ 332{
330 struct symbol *s = find_symbol(name); 333 struct symbol *s = find_symbol(name);
331 334
332 if (!s) 335 if (!s) {
333 s = new_symbol(name, mod, export); 336 s = new_symbol(name, mod, export);
337 /* Don't complain when we find it later. */
338 s->preloaded = 1;
339 }
334 s->crc = crc; 340 s->crc = crc;
335 s->crc_valid = 1; 341 s->crc_valid = 1;
336} 342}
@@ -407,6 +413,11 @@ static int parse_elf(struct elf_info *info, const char *filename)
407 413
408 hdr = grab_file(filename, &info->size); 414 hdr = grab_file(filename, &info->size);
409 if (!hdr) { 415 if (!hdr) {
416 if (ignore_missing_files) {
417 fprintf(stderr, "%s: %s (ignored)\n", filename,
418 strerror(errno));
419 return 0;
420 }
410 perror(filename); 421 perror(filename);
411 exit(1); 422 exit(1);
412 } 423 }
@@ -1852,7 +1863,7 @@ static void add_header(struct buffer *b, struct module *mod)
1852 buf_printf(b, "\n"); 1863 buf_printf(b, "\n");
1853 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); 1864 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
1854 buf_printf(b, "\n"); 1865 buf_printf(b, "\n");
1855 buf_printf(b, "struct module __this_module\n"); 1866 buf_printf(b, "__visible struct module __this_module\n");
1856 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); 1867 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
1857 buf_printf(b, "\t.name = KBUILD_MODNAME,\n"); 1868 buf_printf(b, "\t.name = KBUILD_MODNAME,\n");
1858 if (mod->has_init) 1869 if (mod->has_init)
@@ -2118,7 +2129,7 @@ int main(int argc, char **argv)
2118 struct ext_sym_list *extsym_iter; 2129 struct ext_sym_list *extsym_iter;
2119 struct ext_sym_list *extsym_start = NULL; 2130 struct ext_sym_list *extsym_start = NULL;
2120 2131
2121 while ((opt = getopt(argc, argv, "i:I:e:msST:o:awM:K:")) != -1) { 2132 while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:")) != -1) {
2122 switch (opt) { 2133 switch (opt) {
2123 case 'i': 2134 case 'i':
2124 kernel_read = optarg; 2135 kernel_read = optarg;
@@ -2138,6 +2149,9 @@ int main(int argc, char **argv)
2138 case 'm': 2149 case 'm':
2139 modversions = 1; 2150 modversions = 1;
2140 break; 2151 break;
2152 case 'n':
2153 ignore_missing_files = 1;
2154 break;
2141 case 'o': 2155 case 'o':
2142 dump_write = optarg; 2156 dump_write = optarg;
2143 break; 2157 break;