kallsyms.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /*
  2. * kallsyms.c: in-kernel printing of symbolic oopses and stack traces.
  3. *
  4. * Rewritten and vastly simplified by Rusty Russell for in-kernel
  5. * module loader:
  6. * Copyright 2002 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation
  7. *
  8. * ChangeLog:
  9. *
  10. * (25/Aug/2004) Paulo Marques <pmarques@grupopie.com>
  11. * Changed the compression method from stem compression to "table lookup"
  12. * compression (see scripts/kallsyms.c for a more complete description)
  13. */
  14. #include <linux/kallsyms.h>
  15. #include <linux/init.h>
  16. #include <linux/seq_file.h>
  17. #include <linux/fs.h>
  18. #include <linux/kdb.h>
  19. #include <linux/err.h>
  20. #include <linux/proc_fs.h>
  21. #include <linux/sched.h> /* for cond_resched */
  22. #include <linux/ctype.h>
  23. #include <linux/slab.h>
  24. #include <linux/filter.h>
  25. #include <linux/ftrace.h>
  26. #include <linux/compiler.h>
  27. /*
  28. * These will be re-linked against their real values
  29. * during the second link stage.
  30. */
  31. extern const unsigned long kallsyms_addresses[] __weak;
  32. extern const int kallsyms_offsets[] __weak;
  33. extern const u8 kallsyms_names[] __weak;
  34. /*
  35. * Tell the compiler that the count isn't in the small data section if the arch
  36. * has one (eg: FRV).
  37. */
  38. extern const unsigned long kallsyms_num_syms
  39. __attribute__((weak, section(".rodata")));
  40. extern const unsigned long kallsyms_relative_base
  41. __attribute__((weak, section(".rodata")));
  42. extern const u8 kallsyms_token_table[] __weak;
  43. extern const u16 kallsyms_token_index[] __weak;
  44. extern const unsigned long kallsyms_markers[] __weak;
  45. /*
  46. * Expand a compressed symbol data into the resulting uncompressed string,
  47. * if uncompressed string is too long (>= maxlen), it will be truncated,
  48. * given the offset to where the symbol is in the compressed stream.
  49. */
  50. static unsigned int kallsyms_expand_symbol(unsigned int off,
  51. char *result, size_t maxlen)
  52. {
  53. int len, skipped_first = 0;
  54. const u8 *tptr, *data;
  55. /* Get the compressed symbol length from the first symbol byte. */
  56. data = &kallsyms_names[off];
  57. len = *data;
  58. data++;
  59. /*
  60. * Update the offset to return the offset for the next symbol on
  61. * the compressed stream.
  62. */
  63. off += len + 1;
  64. /*
  65. * For every byte on the compressed symbol data, copy the table
  66. * entry for that byte.
  67. */
  68. while (len) {
  69. tptr = &kallsyms_token_table[kallsyms_token_index[*data]];
  70. data++;
  71. len--;
  72. while (*tptr) {
  73. if (skipped_first) {
  74. if (maxlen <= 1)
  75. goto tail;
  76. *result = *tptr;
  77. result++;
  78. maxlen--;
  79. } else
  80. skipped_first = 1;
  81. tptr++;
  82. }
  83. }
  84. tail:
  85. if (maxlen)
  86. *result = '\0';
  87. /* Return to offset to the next symbol. */
  88. return off;
  89. }
  90. /*
  91. * Get symbol type information. This is encoded as a single char at the
  92. * beginning of the symbol name.
  93. */
  94. static char kallsyms_get_symbol_type(unsigned int off)
  95. {
  96. /*
  97. * Get just the first code, look it up in the token table,
  98. * and return the first char from this token.
  99. */
  100. return kallsyms_token_table[kallsyms_token_index[kallsyms_names[off + 1]]];
  101. }
  102. /*
  103. * Find the offset on the compressed stream given and index in the
  104. * kallsyms array.
  105. */
  106. static unsigned int get_symbol_offset(unsigned long pos)
  107. {
  108. const u8 *name;
  109. int i;
  110. /*
  111. * Use the closest marker we have. We have markers every 256 positions,
  112. * so that should be close enough.
  113. */
  114. name = &kallsyms_names[kallsyms_markers[pos >> 8]];
  115. /*
  116. * Sequentially scan all the symbols up to the point we're searching
  117. * for. Every symbol is stored in a [<len>][<len> bytes of data] format,
  118. * so we just need to add the len to the current pointer for every
  119. * symbol we wish to skip.
  120. */
  121. for (i = 0; i < (pos & 0xFF); i++)
  122. name = name + (*name) + 1;
  123. return name - kallsyms_names;
  124. }
  125. static unsigned long kallsyms_sym_address(int idx)
  126. {
  127. if (!IS_ENABLED(CONFIG_KALLSYMS_BASE_RELATIVE))
  128. return kallsyms_addresses[idx];
  129. /* values are unsigned offsets if --absolute-percpu is not in effect */
  130. if (!IS_ENABLED(CONFIG_KALLSYMS_ABSOLUTE_PERCPU))
  131. return kallsyms_relative_base + (u32)kallsyms_offsets[idx];
  132. /* ...otherwise, positive offsets are absolute values */
  133. if (kallsyms_offsets[idx] >= 0)
  134. return kallsyms_offsets[idx];
  135. /* ...and negative offsets are relative to kallsyms_relative_base - 1 */
  136. return kallsyms_relative_base - 1 - kallsyms_offsets[idx];
  137. }
  138. /* Lookup the address for this symbol. Returns 0 if not found. */
  139. unsigned long kallsyms_lookup_name(const char *name)
  140. {
  141. char namebuf[KSYM_NAME_LEN];
  142. unsigned long i;
  143. unsigned int off;
  144. for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
  145. off = kallsyms_expand_symbol(off, namebuf, ARRAY_SIZE(namebuf));
  146. if (strcmp(namebuf, name) == 0)
  147. return kallsyms_sym_address(i);
  148. }
  149. return module_kallsyms_lookup_name(name);
  150. }
  151. EXPORT_SYMBOL_GPL(kallsyms_lookup_name);
  152. int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
  153. unsigned long),
  154. void *data)
  155. {
  156. char namebuf[KSYM_NAME_LEN];
  157. unsigned long i;
  158. unsigned int off;
  159. int ret;
  160. for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
  161. off = kallsyms_expand_symbol(off, namebuf, ARRAY_SIZE(namebuf));
  162. ret = fn(data, namebuf, NULL, kallsyms_sym_address(i));
  163. if (ret != 0)
  164. return ret;
  165. }
  166. return module_kallsyms_on_each_symbol(fn, data);
  167. }
  168. EXPORT_SYMBOL_GPL(kallsyms_on_each_symbol);
  169. static unsigned long get_symbol_pos(unsigned long addr,
  170. unsigned long *symbolsize,
  171. unsigned long *offset)
  172. {
  173. unsigned long symbol_start = 0, symbol_end = 0;
  174. unsigned long i, low, high, mid;
  175. /* This kernel should never had been booted. */
  176. if (!IS_ENABLED(CONFIG_KALLSYMS_BASE_RELATIVE))
  177. BUG_ON(!kallsyms_addresses);
  178. else
  179. BUG_ON(!kallsyms_offsets);
  180. /* Do a binary search on the sorted kallsyms_addresses array. */
  181. low = 0;
  182. high = kallsyms_num_syms;
  183. while (high - low > 1) {
  184. mid = low + (high - low) / 2;
  185. if (kallsyms_sym_address(mid) <= addr)
  186. low = mid;
  187. else
  188. high = mid;
  189. }
  190. /*
  191. * Search for the first aliased symbol. Aliased
  192. * symbols are symbols with the same address.
  193. */
  194. while (low && kallsyms_sym_address(low-1) == kallsyms_sym_address(low))
  195. --low;
  196. symbol_start = kallsyms_sym_address(low);
  197. /* Search for next non-aliased symbol. */
  198. for (i = low + 1; i < kallsyms_num_syms; i++) {
  199. if (kallsyms_sym_address(i) > symbol_start) {
  200. symbol_end = kallsyms_sym_address(i);
  201. break;
  202. }
  203. }
  204. /* If we found no next symbol, we use the end of the section. */
  205. if (!symbol_end) {
  206. if (is_kernel_inittext(addr))
  207. symbol_end = (unsigned long)_einittext;
  208. else if (IS_ENABLED(CONFIG_KALLSYMS_ALL))
  209. symbol_end = (unsigned long)_end;
  210. else
  211. symbol_end = (unsigned long)_etext;
  212. }
  213. if (symbolsize)
  214. *symbolsize = symbol_end - symbol_start;
  215. if (offset)
  216. *offset = addr - symbol_start;
  217. return low;
  218. }
  219. /*
  220. * Lookup an address but don't bother to find any names.
  221. */
  222. int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize,
  223. unsigned long *offset)
  224. {
  225. char namebuf[KSYM_NAME_LEN];
  226. if (is_ksym_addr(addr))
  227. return !!get_symbol_pos(addr, symbolsize, offset);
  228. return !!module_address_lookup(addr, symbolsize, offset, NULL, namebuf) ||
  229. !!__bpf_address_lookup(addr, symbolsize, offset, namebuf);
  230. }
  231. /*
  232. * Lookup an address
  233. * - modname is set to NULL if it's in the kernel.
  234. * - We guarantee that the returned name is valid until we reschedule even if.
  235. * It resides in a module.
  236. * - We also guarantee that modname will be valid until rescheduled.
  237. */
  238. const char *kallsyms_lookup(unsigned long addr,
  239. unsigned long *symbolsize,
  240. unsigned long *offset,
  241. char **modname, char *namebuf)
  242. {
  243. const char *ret;
  244. namebuf[KSYM_NAME_LEN - 1] = 0;
  245. namebuf[0] = 0;
  246. if (is_ksym_addr(addr)) {
  247. unsigned long pos;
  248. pos = get_symbol_pos(addr, symbolsize, offset);
  249. /* Grab name */
  250. kallsyms_expand_symbol(get_symbol_offset(pos),
  251. namebuf, KSYM_NAME_LEN);
  252. if (modname)
  253. *modname = NULL;
  254. return namebuf;
  255. }
  256. /* See if it's in a module or a BPF JITed image. */
  257. ret = module_address_lookup(addr, symbolsize, offset,
  258. modname, namebuf);
  259. if (!ret)
  260. ret = bpf_address_lookup(addr, symbolsize,
  261. offset, modname, namebuf);
  262. if (!ret)
  263. ret = ftrace_mod_address_lookup(addr, symbolsize,
  264. offset, modname, namebuf);
  265. return ret;
  266. }
  267. int lookup_symbol_name(unsigned long addr, char *symname)
  268. {
  269. symname[0] = '\0';
  270. symname[KSYM_NAME_LEN - 1] = '\0';
  271. if (is_ksym_addr(addr)) {
  272. unsigned long pos;
  273. pos = get_symbol_pos(addr, NULL, NULL);
  274. /* Grab name */
  275. kallsyms_expand_symbol(get_symbol_offset(pos),
  276. symname, KSYM_NAME_LEN);
  277. return 0;
  278. }
  279. /* See if it's in a module. */
  280. return lookup_module_symbol_name(addr, symname);
  281. }
  282. int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
  283. unsigned long *offset, char *modname, char *name)
  284. {
  285. name[0] = '\0';
  286. name[KSYM_NAME_LEN - 1] = '\0';
  287. if (is_ksym_addr(addr)) {
  288. unsigned long pos;
  289. pos = get_symbol_pos(addr, size, offset);
  290. /* Grab name */
  291. kallsyms_expand_symbol(get_symbol_offset(pos),
  292. name, KSYM_NAME_LEN);
  293. modname[0] = '\0';
  294. return 0;
  295. }
  296. /* See if it's in a module. */
  297. return lookup_module_symbol_attrs(addr, size, offset, modname, name);
  298. }
  299. /* Look up a kernel symbol and return it in a text buffer. */
  300. static int __sprint_symbol(char *buffer, unsigned long address,
  301. int symbol_offset, int add_offset)
  302. {
  303. char *modname;
  304. const char *name;
  305. unsigned long offset, size;
  306. int len;
  307. address += symbol_offset;
  308. name = kallsyms_lookup(address, &size, &offset, &modname, buffer);
  309. if (!name)
  310. return sprintf(buffer, "0x%lx", address - symbol_offset);
  311. if (name != buffer)
  312. strcpy(buffer, name);
  313. len = strlen(buffer);
  314. offset -= symbol_offset;
  315. if (add_offset)
  316. len += sprintf(buffer + len, "+%#lx/%#lx", offset, size);
  317. if (modname)
  318. len += sprintf(buffer + len, " [%s]", modname);
  319. return len;
  320. }
  321. /**
  322. * sprint_symbol - Look up a kernel symbol and return it in a text buffer
  323. * @buffer: buffer to be stored
  324. * @address: address to lookup
  325. *
  326. * This function looks up a kernel symbol with @address and stores its name,
  327. * offset, size and module name to @buffer if possible. If no symbol was found,
  328. * just saves its @address as is.
  329. *
  330. * This function returns the number of bytes stored in @buffer.
  331. */
  332. int sprint_symbol(char *buffer, unsigned long address)
  333. {
  334. return __sprint_symbol(buffer, address, 0, 1);
  335. }
  336. EXPORT_SYMBOL_GPL(sprint_symbol);
  337. /**
  338. * sprint_symbol_no_offset - Look up a kernel symbol and return it in a text buffer
  339. * @buffer: buffer to be stored
  340. * @address: address to lookup
  341. *
  342. * This function looks up a kernel symbol with @address and stores its name
  343. * and module name to @buffer if possible. If no symbol was found, just saves
  344. * its @address as is.
  345. *
  346. * This function returns the number of bytes stored in @buffer.
  347. */
  348. int sprint_symbol_no_offset(char *buffer, unsigned long address)
  349. {
  350. return __sprint_symbol(buffer, address, 0, 0);
  351. }
  352. EXPORT_SYMBOL_GPL(sprint_symbol_no_offset);
  353. /**
  354. * sprint_backtrace - Look up a backtrace symbol and return it in a text buffer
  355. * @buffer: buffer to be stored
  356. * @address: address to lookup
  357. *
  358. * This function is for stack backtrace and does the same thing as
  359. * sprint_symbol() but with modified/decreased @address. If there is a
  360. * tail-call to the function marked "noreturn", gcc optimized out code after
  361. * the call so that the stack-saved return address could point outside of the
  362. * caller. This function ensures that kallsyms will find the original caller
  363. * by decreasing @address.
  364. *
  365. * This function returns the number of bytes stored in @buffer.
  366. */
  367. int sprint_backtrace(char *buffer, unsigned long address)
  368. {
  369. return __sprint_symbol(buffer, address, -1, 1);
  370. }
  371. /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
  372. struct kallsym_iter {
  373. loff_t pos;
  374. loff_t pos_mod_end;
  375. loff_t pos_ftrace_mod_end;
  376. unsigned long value;
  377. unsigned int nameoff; /* If iterating in core kernel symbols. */
  378. char type;
  379. char name[KSYM_NAME_LEN];
  380. char module_name[MODULE_NAME_LEN];
  381. int exported;
  382. int show_value;
  383. };
  384. static int get_ksymbol_mod(struct kallsym_iter *iter)
  385. {
  386. int ret = module_get_kallsym(iter->pos - kallsyms_num_syms,
  387. &iter->value, &iter->type,
  388. iter->name, iter->module_name,
  389. &iter->exported);
  390. if (ret < 0) {
  391. iter->pos_mod_end = iter->pos;
  392. return 0;
  393. }
  394. return 1;
  395. }
  396. static int get_ksymbol_ftrace_mod(struct kallsym_iter *iter)
  397. {
  398. int ret = ftrace_mod_get_kallsym(iter->pos - iter->pos_mod_end,
  399. &iter->value, &iter->type,
  400. iter->name, iter->module_name,
  401. &iter->exported);
  402. if (ret < 0) {
  403. iter->pos_ftrace_mod_end = iter->pos;
  404. return 0;
  405. }
  406. return 1;
  407. }
  408. static int get_ksymbol_bpf(struct kallsym_iter *iter)
  409. {
  410. iter->module_name[0] = '\0';
  411. iter->exported = 0;
  412. return bpf_get_kallsym(iter->pos - iter->pos_ftrace_mod_end,
  413. &iter->value, &iter->type,
  414. iter->name) < 0 ? 0 : 1;
  415. }
  416. /* Returns space to next name. */
  417. static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
  418. {
  419. unsigned off = iter->nameoff;
  420. iter->module_name[0] = '\0';
  421. iter->value = kallsyms_sym_address(iter->pos);
  422. iter->type = kallsyms_get_symbol_type(off);
  423. off = kallsyms_expand_symbol(off, iter->name, ARRAY_SIZE(iter->name));
  424. return off - iter->nameoff;
  425. }
  426. static void reset_iter(struct kallsym_iter *iter, loff_t new_pos)
  427. {
  428. iter->name[0] = '\0';
  429. iter->nameoff = get_symbol_offset(new_pos);
  430. iter->pos = new_pos;
  431. if (new_pos == 0) {
  432. iter->pos_mod_end = 0;
  433. iter->pos_ftrace_mod_end = 0;
  434. }
  435. }
  436. static int update_iter_mod(struct kallsym_iter *iter, loff_t pos)
  437. {
  438. iter->pos = pos;
  439. if (iter->pos_ftrace_mod_end > 0 &&
  440. iter->pos_ftrace_mod_end < iter->pos)
  441. return get_ksymbol_bpf(iter);
  442. if (iter->pos_mod_end > 0 &&
  443. iter->pos_mod_end < iter->pos) {
  444. if (!get_ksymbol_ftrace_mod(iter))
  445. return get_ksymbol_bpf(iter);
  446. return 1;
  447. }
  448. if (!get_ksymbol_mod(iter)) {
  449. if (!get_ksymbol_ftrace_mod(iter))
  450. return get_ksymbol_bpf(iter);
  451. }
  452. return 1;
  453. }
  454. /* Returns false if pos at or past end of file. */
  455. static int update_iter(struct kallsym_iter *iter, loff_t pos)
  456. {
  457. /* Module symbols can be accessed randomly. */
  458. if (pos >= kallsyms_num_syms)
  459. return update_iter_mod(iter, pos);
  460. /* If we're not on the desired position, reset to new position. */
  461. if (pos != iter->pos)
  462. reset_iter(iter, pos);
  463. iter->nameoff += get_ksymbol_core(iter);
  464. iter->pos++;
  465. return 1;
  466. }
  467. static void *s_next(struct seq_file *m, void *p, loff_t *pos)
  468. {
  469. (*pos)++;
  470. if (!update_iter(m->private, *pos))
  471. return NULL;
  472. return p;
  473. }
  474. static void *s_start(struct seq_file *m, loff_t *pos)
  475. {
  476. if (!update_iter(m->private, *pos))
  477. return NULL;
  478. return m->private;
  479. }
  480. static void s_stop(struct seq_file *m, void *p)
  481. {
  482. }
  483. static int s_show(struct seq_file *m, void *p)
  484. {
  485. void *value;
  486. struct kallsym_iter *iter = m->private;
  487. /* Some debugging symbols have no name. Ignore them. */
  488. if (!iter->name[0])
  489. return 0;
  490. value = iter->show_value ? (void *)iter->value : NULL;
  491. if (iter->module_name[0]) {
  492. char type;
  493. /*
  494. * Label it "global" if it is exported,
  495. * "local" if not exported.
  496. */
  497. type = iter->exported ? toupper(iter->type) :
  498. tolower(iter->type);
  499. seq_printf(m, "%px %c %s\t[%s]\n", value,
  500. type, iter->name, iter->module_name);
  501. } else
  502. seq_printf(m, "%px %c %s\n", value,
  503. iter->type, iter->name);
  504. return 0;
  505. }
  506. static const struct seq_operations kallsyms_op = {
  507. .start = s_start,
  508. .next = s_next,
  509. .stop = s_stop,
  510. .show = s_show
  511. };
  512. static inline int kallsyms_for_perf(void)
  513. {
  514. #ifdef CONFIG_PERF_EVENTS
  515. extern int sysctl_perf_event_paranoid;
  516. if (sysctl_perf_event_paranoid <= 1)
  517. return 1;
  518. #endif
  519. return 0;
  520. }
  521. /*
  522. * We show kallsyms information even to normal users if we've enabled
  523. * kernel profiling and are explicitly not paranoid (so kptr_restrict
  524. * is clear, and sysctl_perf_event_paranoid isn't set).
  525. *
  526. * Otherwise, require CAP_SYSLOG (assuming kptr_restrict isn't set to
  527. * block even that).
  528. */
  529. int kallsyms_show_value(void)
  530. {
  531. switch (kptr_restrict) {
  532. case 0:
  533. if (kallsyms_for_perf())
  534. return 1;
  535. /* fallthrough */
  536. case 1:
  537. if (has_capability_noaudit(current, CAP_SYSLOG))
  538. return 1;
  539. /* fallthrough */
  540. default:
  541. return 0;
  542. }
  543. }
  544. static int kallsyms_open(struct inode *inode, struct file *file)
  545. {
  546. /*
  547. * We keep iterator in m->private, since normal case is to
  548. * s_start from where we left off, so we avoid doing
  549. * using get_symbol_offset for every symbol.
  550. */
  551. struct kallsym_iter *iter;
  552. iter = __seq_open_private(file, &kallsyms_op, sizeof(*iter));
  553. if (!iter)
  554. return -ENOMEM;
  555. reset_iter(iter, 0);
  556. iter->show_value = kallsyms_show_value();
  557. return 0;
  558. }
  559. #ifdef CONFIG_KGDB_KDB
  560. const char *kdb_walk_kallsyms(loff_t *pos)
  561. {
  562. static struct kallsym_iter kdb_walk_kallsyms_iter;
  563. if (*pos == 0) {
  564. memset(&kdb_walk_kallsyms_iter, 0,
  565. sizeof(kdb_walk_kallsyms_iter));
  566. reset_iter(&kdb_walk_kallsyms_iter, 0);
  567. }
  568. while (1) {
  569. if (!update_iter(&kdb_walk_kallsyms_iter, *pos))
  570. return NULL;
  571. ++*pos;
  572. /* Some debugging symbols have no name. Ignore them. */
  573. if (kdb_walk_kallsyms_iter.name[0])
  574. return kdb_walk_kallsyms_iter.name;
  575. }
  576. }
  577. #endif /* CONFIG_KGDB_KDB */
  578. static const struct file_operations kallsyms_operations = {
  579. .open = kallsyms_open,
  580. .read = seq_read,
  581. .llseek = seq_lseek,
  582. .release = seq_release_private,
  583. };
  584. static int __init kallsyms_init(void)
  585. {
  586. proc_create("kallsyms", 0444, NULL, &kallsyms_operations);
  587. return 0;
  588. }
  589. device_initcall(kallsyms_init);