Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * depmod - generate modules.dep |
Bernhard Reutner-Fischer | 6c4dade | 2008-09-25 12:13:34 +0000 | [diff] [blame] | 4 | * Copyright (c) 2008 Bernhard Reutner-Fischer |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 5 | * Copyrihgt (c) 2008 Timo Teras <timo.teras@iki.fi> |
| 6 | * Copyright (c) 2008 Vladimir Dronnikov |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 7 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Denys Vlasenko | b9f2d9f | 2011-01-18 13:58:01 +0100 | [diff] [blame] | 11 | //applet:IF_DEPMOD(APPLET(depmod, BB_DIR_SBIN, BB_SUID_DROP)) |
Denys Vlasenko | c15613c | 2010-10-15 11:29:02 +0200 | [diff] [blame] | 12 | |
Denys Vlasenko | 043b1e5 | 2009-09-06 12:47:55 +0200 | [diff] [blame] | 13 | #include "libbb.h" |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 14 | #include "modutils.h" |
Denys Vlasenko | 043b1e5 | 2009-09-06 12:47:55 +0200 | [diff] [blame] | 15 | #include <sys/utsname.h> /* uname() */ |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 16 | |
Bernhard Reutner-Fischer | cf18010 | 2008-05-26 15:12:01 +0000 | [diff] [blame] | 17 | /* |
| 18 | * Theory of operation: |
| 19 | * - iterate over all modules and record their full path |
| 20 | * - iterate over all modules looking for "depends=" entries |
| 21 | * for each depends, look through our list of full paths and emit if found |
| 22 | */ |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 23 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 24 | typedef struct module_info { |
| 25 | struct module_info *next; |
| 26 | char *name, *modname; |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 27 | llist_t *dependencies; |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 28 | llist_t *aliases; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 29 | llist_t *symbols; |
| 30 | struct module_info *dnext, *dprev; |
| 31 | } module_info; |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 32 | |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 33 | static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARAM, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 34 | void *data, int depth UNUSED_PARAM) |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 35 | { |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 36 | char modname[MODULE_NAME_LEN]; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 37 | module_info **first = (module_info **) data; |
| 38 | char *image, *ptr; |
| 39 | module_info *info; |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 40 | /* Arbitrary. Was sb->st_size, but that breaks .gz etc */ |
| 41 | size_t len = (64*1024*1024 - 4096); |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 42 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 43 | if (strrstr(fname, ".ko") == NULL) |
| 44 | return TRUE; |
Bernhard Reutner-Fischer | 634b022 | 2008-05-28 14:20:20 +0000 | [diff] [blame] | 45 | |
Denis Vlasenko | fc66892 | 2008-11-06 02:32:31 +0000 | [diff] [blame] | 46 | image = xmalloc_open_zipped_read_close(fname, &len); |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 47 | info = xzalloc(sizeof(*info)); |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 48 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 49 | info->next = *first; |
| 50 | *first = info; |
| 51 | |
| 52 | info->dnext = info->dprev = info; |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 53 | info->name = xstrdup(fname + 2); /* skip "./" */ |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 54 | info->modname = xstrdup(filename2modname(fname, modname)); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 55 | for (ptr = image; ptr < image + len - 10; ptr++) { |
| 56 | if (strncmp(ptr, "depends=", 8) == 0) { |
| 57 | char *u; |
| 58 | |
| 59 | ptr += 8; |
| 60 | for (u = ptr; *u; u++) |
| 61 | if (*u == '-') |
| 62 | *u = '_'; |
| 63 | ptr += string_to_llist(ptr, &info->dependencies, ","); |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 64 | } else if (ENABLE_FEATURE_MODUTILS_ALIAS |
| 65 | && strncmp(ptr, "alias=", 6) == 0 |
| 66 | ) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 67 | llist_add_to(&info->aliases, xstrdup(ptr + 6)); |
| 68 | ptr += strlen(ptr); |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 69 | } else if (ENABLE_FEATURE_MODUTILS_SYMBOLS |
| 70 | && strncmp(ptr, "__ksymtab_", 10) == 0 |
| 71 | ) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 72 | ptr += 10; |
Denys Vlasenko | 6b9f163 | 2010-01-28 02:24:24 +0100 | [diff] [blame] | 73 | if (strncmp(ptr, "gpl", 3) == 0 |
| 74 | || strcmp(ptr, "strings") == 0 |
| 75 | ) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 76 | continue; |
Denys Vlasenko | 6b9f163 | 2010-01-28 02:24:24 +0100 | [diff] [blame] | 77 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 78 | llist_add_to(&info->symbols, xstrdup(ptr)); |
| 79 | ptr += strlen(ptr); |
| 80 | } |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 81 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 82 | free(image); |
| 83 | |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 84 | return TRUE; |
| 85 | } |
| 86 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 87 | static module_info *find_module(module_info *modules, const char *modname) |
| 88 | { |
| 89 | module_info *m; |
| 90 | |
| 91 | for (m = modules; m != NULL; m = m->next) |
| 92 | if (strcmp(m->modname, modname) == 0) |
| 93 | return m; |
| 94 | return NULL; |
| 95 | } |
| 96 | |
| 97 | static void order_dep_list(module_info *modules, module_info *start, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 98 | llist_t *add) |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 99 | { |
| 100 | module_info *m; |
| 101 | llist_t *n; |
| 102 | |
| 103 | for (n = add; n != NULL; n = n->link) { |
| 104 | m = find_module(modules, n->data); |
| 105 | if (m == NULL) |
| 106 | continue; |
| 107 | |
| 108 | /* unlink current entry */ |
| 109 | m->dnext->dprev = m->dprev; |
| 110 | m->dprev->dnext = m->dnext; |
| 111 | |
| 112 | /* and add it to tail */ |
| 113 | m->dnext = start; |
| 114 | m->dprev = start->dprev; |
| 115 | start->dprev->dnext = m; |
| 116 | start->dprev = m; |
| 117 | |
| 118 | /* recurse */ |
| 119 | order_dep_list(modules, start, m->dependencies); |
| 120 | } |
| 121 | } |
| 122 | |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 123 | static void xfreopen_write(const char *file, FILE *f) |
| 124 | { |
| 125 | if (freopen(file, "w", f) == NULL) |
| 126 | bb_perror_msg_and_die("can't open '%s'", file); |
| 127 | } |
| 128 | |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 129 | //usage:#if !ENABLE_MODPROBE_SMALL |
| 130 | //usage:#define depmod_trivial_usage "[-n] [-b BASE] [VERSION] [MODFILES]..." |
| 131 | //usage:#define depmod_full_usage "\n\n" |
| 132 | //usage: "Generate modules.dep, alias, and symbols files" |
| 133 | //usage: "\n" |
| 134 | //usage: "\n -b BASE Use BASE/lib/modules/VERSION" |
| 135 | //usage: "\n -n Dry run: print files to stdout" |
| 136 | //usage:#endif |
| 137 | |
| 138 | /* Upstream usage: |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 139 | * [-aAenv] [-C FILE or DIR] [-b BASE] [-F System.map] [VERSION] [MODFILES]... |
| 140 | * -a --all |
| 141 | * Probe all modules. Default if no MODFILES. |
| 142 | * -A --quick |
| 143 | * Check modules.dep's mtime against module files' mtimes. |
| 144 | * -b --basedir BASE |
| 145 | * Use $BASE/lib/modules/VERSION |
| 146 | * -C --config FILE or DIR |
| 147 | * Path to /etc/depmod.conf or /etc/depmod.d/ |
| 148 | * -e --errsyms |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 149 | * When combined with the -F option, this reports any symbols |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 150 | * which are not supplied by other modules or kernel. |
| 151 | * -F --filesyms System.map |
| 152 | * -n --dry-run |
| 153 | * Print modules.dep etc to standard output |
| 154 | * -v --verbose |
| 155 | * Print to stdout all the symbols each module depends on |
| 156 | * and the module's file name which provides that symbol. |
| 157 | * -r No-op |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 158 | * -u No-op |
| 159 | * -q No-op |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 160 | * |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 161 | * So far we only support: [-n] [-b BASE] [VERSION] [MODFILES]... |
| 162 | * Accepted but ignored: |
| 163 | * -aAe |
| 164 | * -F System.map |
| 165 | * -C FILE/DIR |
| 166 | * |
| 167 | * Not accepted: -v |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 168 | */ |
| 169 | enum { |
| 170 | //OPT_a = (1 << 0), /* All modules, ignore mods in argv */ |
| 171 | //OPT_A = (1 << 1), /* Only emit .ko that are newer than modules.dep file */ |
| 172 | OPT_b = (1 << 2), /* base directory when modules are in staging area */ |
| 173 | //OPT_e = (1 << 3), /* with -F, print unresolved symbols */ |
| 174 | //OPT_F = (1 << 4), /* System.map that contains the symbols */ |
| 175 | OPT_n = (1 << 5), /* dry-run, print to stdout only */ |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 176 | OPT_r = (1 << 6), /* Compat dummy. Linux Makefile uses it */ |
| 177 | OPT_u = (1 << 7), /* -u,--unresolved-error: ignored */ |
| 178 | OPT_q = (1 << 8), /* -q,--quiet: ignored */ |
| 179 | OPT_C = (1 << 9), /* -C,--config etc_modules_conf: ignored */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 180 | }; |
| 181 | |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 182 | int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 183 | int depmod_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 184 | { |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 185 | module_info *modules, *m, *dep; |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 186 | const char *moddir_base = "/"; |
| 187 | char *moddir, *version; |
| 188 | struct utsname uts; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 189 | int tmp; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 190 | |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 191 | getopt32(argv, "aAb:eF:nruqC:", &moddir_base, NULL, NULL); |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 192 | argv += optind; |
Bernhard Reutner-Fischer | c21d9c7 | 2008-05-28 10:35:51 +0000 | [diff] [blame] | 193 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 194 | /* goto modules location */ |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 195 | xchdir(moddir_base); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 196 | |
| 197 | /* If a version is provided, then that kernel version's module directory |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 198 | * is used, rather than the current kernel version (as returned by |
| 199 | * "uname -r"). */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 200 | if (*argv && sscanf(*argv, "%u.%u.%u", &tmp, &tmp, &tmp) == 3) { |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 201 | version = *argv++; |
Bernhard Reutner-Fischer | 1ea2568 | 2008-05-26 21:33:05 +0000 | [diff] [blame] | 202 | } else { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 203 | uname(&uts); |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 204 | version = uts.release; |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 205 | } |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 206 | moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version); |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 207 | xchdir(moddir); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 208 | if (ENABLE_FEATURE_CLEAN_UP) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 209 | free(moddir); |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 210 | |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 211 | /* Scan modules */ |
| 212 | modules = NULL; |
| 213 | if (*argv) { |
| 214 | do { |
| 215 | parse_module(*argv, /*sb (unused):*/ NULL, &modules, 0); |
| 216 | } while (*++argv); |
| 217 | } else { |
| 218 | recursive_action(".", ACTION_RECURSE, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 219 | parse_module, NULL, &modules, 0); |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 222 | /* Generate dependency and alias files */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 223 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 224 | xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 225 | for (m = modules; m != NULL; m = m->next) { |
| 226 | printf("%s:", m->name); |
| 227 | |
| 228 | order_dep_list(modules, m, m->dependencies); |
| 229 | while (m->dnext != m) { |
| 230 | dep = m->dnext; |
| 231 | printf(" %s", dep->name); |
| 232 | |
| 233 | /* unlink current entry */ |
| 234 | dep->dnext->dprev = dep->dprev; |
| 235 | dep->dprev->dnext = dep->dnext; |
| 236 | dep->dnext = dep->dprev = dep; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 237 | } |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 238 | bb_putchar('\n'); |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 239 | } |
| 240 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 241 | #if ENABLE_FEATURE_MODUTILS_ALIAS |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 242 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 243 | xfreopen_write("modules.alias", stdout); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 244 | for (m = modules; m != NULL; m = m->next) { |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 245 | const char *fname = bb_basename(m->name); |
| 246 | int fnlen = strchrnul(fname, '.') - fname; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 247 | while (m->aliases) { |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 248 | /* Last word can well be m->modname instead, |
| 249 | * but depmod from module-init-tools 3.4 |
| 250 | * uses module basename, i.e., no s/-/_/g. |
| 251 | * (pathname and .ko.* are still stripped) |
| 252 | * Mimicking that... */ |
| 253 | printf("alias %s %.*s\n", |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 254 | (char*)llist_pop(&m->aliases), |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 255 | fnlen, fname); |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 256 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 257 | } |
| 258 | #endif |
| 259 | #if ENABLE_FEATURE_MODUTILS_SYMBOLS |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 260 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 261 | xfreopen_write("modules.symbols", stdout); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 262 | for (m = modules; m != NULL; m = m->next) { |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 263 | const char *fname = bb_basename(m->name); |
| 264 | int fnlen = strchrnul(fname, '.') - fname; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 265 | while (m->symbols) { |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 266 | printf("alias symbol:%s %.*s\n", |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 267 | (char*)llist_pop(&m->symbols), |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 268 | fnlen, fname); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 269 | } |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 270 | } |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 271 | #endif |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 272 | |
Bernhard Reutner-Fischer | dc5d7fe | 2008-05-26 13:30:41 +0000 | [diff] [blame] | 273 | if (ENABLE_FEATURE_CLEAN_UP) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 274 | while (modules) { |
| 275 | module_info *old = modules; |
| 276 | modules = modules->next; |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 277 | free(old->name); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 278 | free(old->modname); |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 279 | free(old); |
| 280 | } |
Bernhard Reutner-Fischer | dc5d7fe | 2008-05-26 13:30:41 +0000 | [diff] [blame] | 281 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 282 | |
| 283 | return EXIT_SUCCESS; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 284 | } |