diff options
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 843f6fa517cc..f8b42ab0724b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -2019,6 +2019,11 @@ static void write_markers(const char *fname) | |||
2019 | write_if_changed(&buf, fname); | 2019 | write_if_changed(&buf, fname); |
2020 | } | 2020 | } |
2021 | 2021 | ||
2022 | struct ext_sym_list { | ||
2023 | struct ext_sym_list *next; | ||
2024 | const char *file; | ||
2025 | }; | ||
2026 | |||
2022 | int main(int argc, char **argv) | 2027 | int main(int argc, char **argv) |
2023 | { | 2028 | { |
2024 | struct module *mod; | 2029 | struct module *mod; |
@@ -2029,8 +2034,10 @@ int main(int argc, char **argv) | |||
2029 | char *markers_write = NULL; | 2034 | char *markers_write = NULL; |
2030 | int opt; | 2035 | int opt; |
2031 | int err; | 2036 | int err; |
2037 | struct ext_sym_list *extsym_iter; | ||
2038 | struct ext_sym_list *extsym_start = NULL; | ||
2032 | 2039 | ||
2033 | while ((opt = getopt(argc, argv, "i:I:cmsSo:awM:K:")) != -1) { | 2040 | while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:")) != -1) { |
2034 | switch (opt) { | 2041 | switch (opt) { |
2035 | case 'i': | 2042 | case 'i': |
2036 | kernel_read = optarg; | 2043 | kernel_read = optarg; |
@@ -2042,6 +2049,14 @@ int main(int argc, char **argv) | |||
2042 | case 'c': | 2049 | case 'c': |
2043 | cross_build = 1; | 2050 | cross_build = 1; |
2044 | break; | 2051 | break; |
2052 | case 'e': | ||
2053 | external_module = 1; | ||
2054 | extsym_iter = | ||
2055 | NOFAIL(malloc(sizeof(*extsym_iter))); | ||
2056 | extsym_iter->next = extsym_start; | ||
2057 | extsym_iter->file = optarg; | ||
2058 | extsym_start = extsym_iter; | ||
2059 | break; | ||
2045 | case 'm': | 2060 | case 'm': |
2046 | modversions = 1; | 2061 | modversions = 1; |
2047 | break; | 2062 | break; |
@@ -2075,6 +2090,12 @@ int main(int argc, char **argv) | |||
2075 | read_dump(kernel_read, 1); | 2090 | read_dump(kernel_read, 1); |
2076 | if (module_read) | 2091 | if (module_read) |
2077 | read_dump(module_read, 0); | 2092 | read_dump(module_read, 0); |
2093 | while (extsym_start) { | ||
2094 | read_dump(extsym_start->file, 0); | ||
2095 | extsym_iter = extsym_start->next; | ||
2096 | free(extsym_start); | ||
2097 | extsym_start = extsym_iter; | ||
2098 | } | ||
2078 | 2099 | ||
2079 | while (optind < argc) | 2100 | while (optind < argc) |
2080 | read_symbols(argv[optind++]); | 2101 | read_symbols(argv[optind++]); |