aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.modpost4
-rw-r--r--scripts/mod/modpost.c13
2 files changed, 15 insertions, 2 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 8247979e8f64..393706b37774 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,
@@ -407,6 +410,11 @@ static int parse_elf(struct elf_info *info, const char *filename)
407 410
408 hdr = grab_file(filename, &info->size); 411 hdr = grab_file(filename, &info->size);
409 if (!hdr) { 412 if (!hdr) {
413 if (ignore_missing_files) {
414 fprintf(stderr, "%s: %s (ignored)\n", filename,
415 strerror(errno));
416 return 0;
417 }
410 perror(filename); 418 perror(filename);
411 exit(1); 419 exit(1);
412 } 420 }
@@ -2119,7 +2127,7 @@ int main(int argc, char **argv)
2119 struct ext_sym_list *extsym_iter; 2127 struct ext_sym_list *extsym_iter;
2120 struct ext_sym_list *extsym_start = NULL; 2128 struct ext_sym_list *extsym_start = NULL;
2121 2129
2122 while ((opt = getopt(argc, argv, "i:I:e:msST:o:awM:K:")) != -1) { 2130 while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:")) != -1) {
2123 switch (opt) { 2131 switch (opt) {
2124 case 'i': 2132 case 'i':
2125 kernel_read = optarg; 2133 kernel_read = optarg;
@@ -2139,6 +2147,9 @@ int main(int argc, char **argv)
2139 case 'm': 2147 case 'm':
2140 modversions = 1; 2148 modversions = 1;
2141 break; 2149 break;
2150 case 'n':
2151 ignore_missing_files = 1;
2152 break;
2142 case 'o': 2153 case 'o':
2143 dump_write = optarg; 2154 dump_write = optarg;
2144 break; 2155 break;