module.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. #ifndef _LINUX_MODULE_H
  2. #define _LINUX_MODULE_H
  3. /*
  4. * Dynamic loading of modules into the kernel.
  5. *
  6. * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
  7. * Rewritten again by Rusty Russell, 2002
  8. */
  9. #include <linux/list.h>
  10. #include <linux/stat.h>
  11. #include <linux/compiler.h>
  12. #include <linux/cache.h>
  13. #include <linux/kmod.h>
  14. #include <linux/elf.h>
  15. #include <linux/stringify.h>
  16. #include <linux/kobject.h>
  17. #include <linux/moduleparam.h>
  18. #include <linux/jump_label.h>
  19. #include <linux/export.h>
  20. #include <linux/rbtree_latch.h>
  21. #include <linux/percpu.h>
  22. #include <asm/module.h>
  23. /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
  24. #define MODULE_SIG_STRING "~Module signature appended~\n"
  25. /* Not Yet Implemented */
  26. #define MODULE_SUPPORTED_DEVICE(name)
  27. #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
  28. struct modversion_info {
  29. unsigned long crc;
  30. char name[MODULE_NAME_LEN];
  31. };
  32. struct module;
  33. struct module_kobject {
  34. struct kobject kobj;
  35. struct module *mod;
  36. struct kobject *drivers_dir;
  37. struct module_param_attrs *mp;
  38. struct completion *kobj_completion;
  39. };
  40. struct module_attribute {
  41. struct attribute attr;
  42. ssize_t (*show)(struct module_attribute *, struct module_kobject *,
  43. char *);
  44. ssize_t (*store)(struct module_attribute *, struct module_kobject *,
  45. const char *, size_t count);
  46. void (*setup)(struct module *, const char *);
  47. int (*test)(struct module *);
  48. void (*free)(struct module *);
  49. };
  50. struct module_version_attribute {
  51. struct module_attribute mattr;
  52. const char *module_name;
  53. const char *version;
  54. } __attribute__ ((__aligned__(sizeof(void *))));
  55. extern ssize_t __modver_version_show(struct module_attribute *,
  56. struct module_kobject *, char *);
  57. extern struct module_attribute module_uevent;
  58. /* These are either module local, or the kernel's dummy ones. */
  59. extern int init_module(void);
  60. extern void cleanup_module(void);
  61. /* Archs provide a method of finding the correct exception table. */
  62. struct exception_table_entry;
  63. const struct exception_table_entry *
  64. search_extable(const struct exception_table_entry *first,
  65. const struct exception_table_entry *last,
  66. unsigned long value);
  67. void sort_extable(struct exception_table_entry *start,
  68. struct exception_table_entry *finish);
  69. void sort_main_extable(void);
  70. void trim_init_extable(struct module *m);
  71. /* Generic info of form tag = "info" */
  72. #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
  73. /* For userspace: you can also call me... */
  74. #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
  75. /* Soft module dependencies. See man modprobe.d for details.
  76. * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz")
  77. */
  78. #define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep)
  79. /*
  80. * The following license idents are currently accepted as indicating free
  81. * software modules
  82. *
  83. * "GPL" [GNU Public License v2 or later]
  84. * "GPL v2" [GNU Public License v2]
  85. * "GPL and additional rights" [GNU Public License v2 rights and more]
  86. * "Dual BSD/GPL" [GNU Public License v2
  87. * or BSD license choice]
  88. * "Dual MIT/GPL" [GNU Public License v2
  89. * or MIT license choice]
  90. * "Dual MPL/GPL" [GNU Public License v2
  91. * or Mozilla license choice]
  92. *
  93. * The following other idents are available
  94. *
  95. * "Proprietary" [Non free products]
  96. *
  97. * There are dual licensed components, but when running with Linux it is the
  98. * GPL that is relevant so this is a non issue. Similarly LGPL linked with GPL
  99. * is a GPL combined work.
  100. *
  101. * This exists for several reasons
  102. * 1. So modinfo can show license info for users wanting to vet their setup
  103. * is free
  104. * 2. So the community can ignore bug reports including proprietary modules
  105. * 3. So vendors can do likewise based on their own policies
  106. */
  107. #define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
  108. /*
  109. * Author(s), use "Name <email>" or just "Name", for multiple
  110. * authors use multiple MODULE_AUTHOR() statements/lines.
  111. */
  112. #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
  113. /* What your module does. */
  114. #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
  115. #ifdef MODULE
  116. /* Creates an alias so file2alias.c can find device table. */
  117. #define MODULE_DEVICE_TABLE(type, name) \
  118. extern const typeof(name) __mod_##type##__##name##_device_table \
  119. __attribute__ ((unused, alias(__stringify(name))))
  120. #else /* !MODULE */
  121. #define MODULE_DEVICE_TABLE(type, name)
  122. #endif
  123. /* Version of form [<epoch>:]<version>[-<extra-version>].
  124. * Or for CVS/RCS ID version, everything but the number is stripped.
  125. * <epoch>: A (small) unsigned integer which allows you to start versions
  126. * anew. If not mentioned, it's zero. eg. "2:1.0" is after
  127. * "1:2.0".
  128. * <version>: The <version> may contain only alphanumerics and the
  129. * character `.'. Ordered by numeric sort for numeric parts,
  130. * ascii sort for ascii parts (as per RPM or DEB algorithm).
  131. * <extraversion>: Like <version>, but inserted for local
  132. * customizations, eg "rh3" or "rusty1".
  133. * Using this automatically adds a checksum of the .c files and the
  134. * local headers in "srcversion".
  135. */
  136. #if defined(MODULE) || !defined(CONFIG_SYSFS)
  137. #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
  138. #else
  139. #define MODULE_VERSION(_version) \
  140. static struct module_version_attribute ___modver_attr = { \
  141. .mattr = { \
  142. .attr = { \
  143. .name = "version", \
  144. .mode = S_IRUGO, \
  145. }, \
  146. .show = __modver_version_show, \
  147. }, \
  148. .module_name = KBUILD_MODNAME, \
  149. .version = _version, \
  150. }; \
  151. static const struct module_version_attribute \
  152. __used __attribute__ ((__section__ ("__modver"))) \
  153. * __moduleparam_const __modver_attr = &___modver_attr
  154. #endif
  155. /* Optional firmware file (or files) needed by the module
  156. * format is simply firmware file name. Multiple firmware
  157. * files require multiple MODULE_FIRMWARE() specifiers */
  158. #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
  159. /* Given an address, look for it in the exception tables */
  160. const struct exception_table_entry *search_exception_tables(unsigned long add);
  161. struct notifier_block;
  162. #ifdef CONFIG_MODULES
  163. extern int modules_disabled; /* for sysctl */
  164. /* Get/put a kernel symbol (calls must be symmetric) */
  165. void *__symbol_get(const char *symbol);
  166. void *__symbol_get_gpl(const char *symbol);
  167. #define symbol_get(x) ((typeof(&x))(__symbol_get(VMLINUX_SYMBOL_STR(x))))
  168. /* modules using other modules: kdb wants to see this. */
  169. struct module_use {
  170. struct list_head source_list;
  171. struct list_head target_list;
  172. struct module *source, *target;
  173. };
  174. enum module_state {
  175. MODULE_STATE_LIVE, /* Normal state. */
  176. MODULE_STATE_COMING, /* Full formed, running module_init. */
  177. MODULE_STATE_GOING, /* Going away. */
  178. MODULE_STATE_UNFORMED, /* Still setting it up. */
  179. };
  180. struct module;
  181. struct mod_tree_node {
  182. struct module *mod;
  183. struct latch_tree_node node;
  184. };
  185. struct module {
  186. enum module_state state;
  187. /* Member of list of modules */
  188. struct list_head list;
  189. /* Unique handle for this module */
  190. char name[MODULE_NAME_LEN];
  191. /* Sysfs stuff. */
  192. struct module_kobject mkobj;
  193. struct module_attribute *modinfo_attrs;
  194. const char *version;
  195. const char *srcversion;
  196. struct kobject *holders_dir;
  197. /* Exported symbols */
  198. const struct kernel_symbol *syms;
  199. const unsigned long *crcs;
  200. unsigned int num_syms;
  201. /* Kernel parameters. */
  202. struct mutex param_lock;
  203. struct kernel_param *kp;
  204. unsigned int num_kp;
  205. /* GPL-only exported symbols. */
  206. unsigned int num_gpl_syms;
  207. const struct kernel_symbol *gpl_syms;
  208. const unsigned long *gpl_crcs;
  209. #ifdef CONFIG_UNUSED_SYMBOLS
  210. /* unused exported symbols. */
  211. const struct kernel_symbol *unused_syms;
  212. const unsigned long *unused_crcs;
  213. unsigned int num_unused_syms;
  214. /* GPL-only, unused exported symbols. */
  215. unsigned int num_unused_gpl_syms;
  216. const struct kernel_symbol *unused_gpl_syms;
  217. const unsigned long *unused_gpl_crcs;
  218. #endif
  219. #ifdef CONFIG_MODULE_SIG
  220. /* Signature was verified. */
  221. bool sig_ok;
  222. #endif
  223. /* symbols that will be GPL-only in the near future. */
  224. const struct kernel_symbol *gpl_future_syms;
  225. const unsigned long *gpl_future_crcs;
  226. unsigned int num_gpl_future_syms;
  227. /* Exception table */
  228. unsigned int num_exentries;
  229. struct exception_table_entry *extable;
  230. /* Startup function. */
  231. int (*init)(void);
  232. /*
  233. * If this is non-NULL, vfree() after init() returns.
  234. *
  235. * Cacheline align here, such that:
  236. * module_init, module_core, init_size, core_size,
  237. * init_text_size, core_text_size and mtn_core::{mod,node[0]}
  238. * are on the same cacheline.
  239. */
  240. void *module_init ____cacheline_aligned;
  241. /* Here is the actual code + data, vfree'd on unload. */
  242. void *module_core;
  243. /* Here are the sizes of the init and core sections */
  244. unsigned int init_size, core_size;
  245. /* The size of the executable code in each section. */
  246. unsigned int init_text_size, core_text_size;
  247. #ifdef CONFIG_MODULES_TREE_LOOKUP
  248. /*
  249. * We want mtn_core::{mod,node[0]} to be in the same cacheline as the
  250. * above entries such that a regular lookup will only touch one
  251. * cacheline.
  252. */
  253. struct mod_tree_node mtn_core;
  254. struct mod_tree_node mtn_init;
  255. #endif
  256. /* Size of RO sections of the module (text+rodata) */
  257. unsigned int init_ro_size, core_ro_size;
  258. /* Arch-specific module values */
  259. struct mod_arch_specific arch;
  260. unsigned int taints; /* same bits as kernel:tainted */
  261. #ifdef CONFIG_GENERIC_BUG
  262. /* Support for BUG */
  263. unsigned num_bugs;
  264. struct list_head bug_list;
  265. struct bug_entry *bug_table;
  266. #endif
  267. #ifdef CONFIG_KALLSYMS
  268. /*
  269. * We keep the symbol and string tables for kallsyms.
  270. * The core_* fields below are temporary, loader-only (they
  271. * could really be discarded after module init).
  272. */
  273. Elf_Sym *symtab, *core_symtab;
  274. unsigned int num_symtab, core_num_syms;
  275. char *strtab, *core_strtab;
  276. /* Section attributes */
  277. struct module_sect_attrs *sect_attrs;
  278. /* Notes attributes */
  279. struct module_notes_attrs *notes_attrs;
  280. #endif
  281. /* The command line arguments (may be mangled). People like
  282. keeping pointers to this stuff */
  283. char *args;
  284. #ifdef CONFIG_SMP
  285. /* Per-cpu data. */
  286. void __percpu *percpu;
  287. unsigned int percpu_size;
  288. #endif
  289. #ifdef CONFIG_TRACEPOINTS
  290. unsigned int num_tracepoints;
  291. struct tracepoint * const *tracepoints_ptrs;
  292. #endif
  293. #ifdef HAVE_JUMP_LABEL
  294. struct jump_entry *jump_entries;
  295. unsigned int num_jump_entries;
  296. #endif
  297. #ifdef CONFIG_TRACING
  298. unsigned int num_trace_bprintk_fmt;
  299. const char **trace_bprintk_fmt_start;
  300. #endif
  301. #ifdef CONFIG_EVENT_TRACING
  302. struct ftrace_event_call **trace_events;
  303. unsigned int num_trace_events;
  304. struct trace_enum_map **trace_enums;
  305. unsigned int num_trace_enums;
  306. #endif
  307. #ifdef CONFIG_FTRACE_MCOUNT_RECORD
  308. unsigned int num_ftrace_callsites;
  309. unsigned long *ftrace_callsites;
  310. #endif
  311. #ifdef CONFIG_LIVEPATCH
  312. bool klp_alive;
  313. #endif
  314. #ifdef CONFIG_MODULE_UNLOAD
  315. /* What modules depend on me? */
  316. struct list_head source_list;
  317. /* What modules do I depend on? */
  318. struct list_head target_list;
  319. /* Destruction function. */
  320. void (*exit)(void);
  321. atomic_t refcnt;
  322. #endif
  323. #ifdef CONFIG_CONSTRUCTORS
  324. /* Constructor functions. */
  325. ctor_fn_t *ctors;
  326. unsigned int num_ctors;
  327. #endif
  328. } ____cacheline_aligned;
  329. #ifndef MODULE_ARCH_INIT
  330. #define MODULE_ARCH_INIT {}
  331. #endif
  332. extern struct mutex module_mutex;
  333. /* FIXME: It'd be nice to isolate modules during init, too, so they
  334. aren't used before they (may) fail. But presently too much code
  335. (IDE & SCSI) require entry into the module during init.*/
  336. static inline int module_is_live(struct module *mod)
  337. {
  338. return mod->state != MODULE_STATE_GOING;
  339. }
  340. struct module *__module_text_address(unsigned long addr);
  341. struct module *__module_address(unsigned long addr);
  342. bool is_module_address(unsigned long addr);
  343. bool is_module_percpu_address(unsigned long addr);
  344. bool is_module_text_address(unsigned long addr);
  345. static inline bool within_module_core(unsigned long addr,
  346. const struct module *mod)
  347. {
  348. return (unsigned long)mod->module_core <= addr &&
  349. addr < (unsigned long)mod->module_core + mod->core_size;
  350. }
  351. static inline bool within_module_init(unsigned long addr,
  352. const struct module *mod)
  353. {
  354. return (unsigned long)mod->module_init <= addr &&
  355. addr < (unsigned long)mod->module_init + mod->init_size;
  356. }
  357. static inline bool within_module(unsigned long addr, const struct module *mod)
  358. {
  359. return within_module_init(addr, mod) || within_module_core(addr, mod);
  360. }
  361. /* Search for module by name: must hold module_mutex. */
  362. struct module *find_module(const char *name);
  363. struct symsearch {
  364. const struct kernel_symbol *start, *stop;
  365. const unsigned long *crcs;
  366. enum {
  367. NOT_GPL_ONLY,
  368. GPL_ONLY,
  369. WILL_BE_GPL_ONLY,
  370. } licence;
  371. bool unused;
  372. };
  373. /*
  374. * Search for an exported symbol by name.
  375. *
  376. * Must be called with module_mutex held or preemption disabled.
  377. */
  378. const struct kernel_symbol *find_symbol(const char *name,
  379. struct module **owner,
  380. const unsigned long **crc,
  381. bool gplok,
  382. bool warn);
  383. /*
  384. * Walk the exported symbol table
  385. *
  386. * Must be called with module_mutex held or preemption disabled.
  387. */
  388. bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
  389. struct module *owner,
  390. void *data), void *data);
  391. /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
  392. symnum out of range. */
  393. int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
  394. char *name, char *module_name, int *exported);
  395. /* Look for this name: can be of form module:name. */
  396. unsigned long module_kallsyms_lookup_name(const char *name);
  397. int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
  398. struct module *, unsigned long),
  399. void *data);
  400. extern void __module_put_and_exit(struct module *mod, long code)
  401. __attribute__((noreturn));
  402. #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
  403. #ifdef CONFIG_MODULE_UNLOAD
  404. int module_refcount(struct module *mod);
  405. void __symbol_put(const char *symbol);
  406. #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x))
  407. void symbol_put_addr(void *addr);
  408. /* Sometimes we know we already have a refcount, and it's easier not
  409. to handle the error case (which only happens with rmmod --wait). */
  410. extern void __module_get(struct module *module);
  411. /* This is the Right Way to get a module: if it fails, it's being removed,
  412. * so pretend it's not there. */
  413. extern bool try_module_get(struct module *module);
  414. extern void module_put(struct module *module);
  415. #else /*!CONFIG_MODULE_UNLOAD*/
  416. static inline int try_module_get(struct module *module)
  417. {
  418. return !module || module_is_live(module);
  419. }
  420. static inline void module_put(struct module *module)
  421. {
  422. }
  423. static inline void __module_get(struct module *module)
  424. {
  425. }
  426. #define symbol_put(x) do { } while (0)
  427. #define symbol_put_addr(p) do { } while (0)
  428. #endif /* CONFIG_MODULE_UNLOAD */
  429. int ref_module(struct module *a, struct module *b);
  430. /* This is a #define so the string doesn't get put in every .o file */
  431. #define module_name(mod) \
  432. ({ \
  433. struct module *__mod = (mod); \
  434. __mod ? __mod->name : "kernel"; \
  435. })
  436. /* For kallsyms to ask for address resolution. namebuf should be at
  437. * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
  438. * found, otherwise NULL. */
  439. const char *module_address_lookup(unsigned long addr,
  440. unsigned long *symbolsize,
  441. unsigned long *offset,
  442. char **modname,
  443. char *namebuf);
  444. int lookup_module_symbol_name(unsigned long addr, char *symname);
  445. int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
  446. /* For extable.c to search modules' exception tables. */
  447. const struct exception_table_entry *search_module_extables(unsigned long addr);
  448. int register_module_notifier(struct notifier_block *nb);
  449. int unregister_module_notifier(struct notifier_block *nb);
  450. extern void print_modules(void);
  451. #else /* !CONFIG_MODULES... */
  452. /* Given an address, look for it in the exception tables. */
  453. static inline const struct exception_table_entry *
  454. search_module_extables(unsigned long addr)
  455. {
  456. return NULL;
  457. }
  458. static inline struct module *__module_address(unsigned long addr)
  459. {
  460. return NULL;
  461. }
  462. static inline struct module *__module_text_address(unsigned long addr)
  463. {
  464. return NULL;
  465. }
  466. static inline bool is_module_address(unsigned long addr)
  467. {
  468. return false;
  469. }
  470. static inline bool is_module_percpu_address(unsigned long addr)
  471. {
  472. return false;
  473. }
  474. static inline bool is_module_text_address(unsigned long addr)
  475. {
  476. return false;
  477. }
  478. /* Get/put a kernel symbol (calls should be symmetric) */
  479. #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
  480. #define symbol_put(x) do { } while (0)
  481. #define symbol_put_addr(x) do { } while (0)
  482. static inline void __module_get(struct module *module)
  483. {
  484. }
  485. static inline int try_module_get(struct module *module)
  486. {
  487. return 1;
  488. }
  489. static inline void module_put(struct module *module)
  490. {
  491. }
  492. #define module_name(mod) "kernel"
  493. /* For kallsyms to ask for address resolution. NULL means not found. */
  494. static inline const char *module_address_lookup(unsigned long addr,
  495. unsigned long *symbolsize,
  496. unsigned long *offset,
  497. char **modname,
  498. char *namebuf)
  499. {
  500. return NULL;
  501. }
  502. static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
  503. {
  504. return -ERANGE;
  505. }
  506. static inline int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
  507. {
  508. return -ERANGE;
  509. }
  510. static inline int module_get_kallsym(unsigned int symnum, unsigned long *value,
  511. char *type, char *name,
  512. char *module_name, int *exported)
  513. {
  514. return -ERANGE;
  515. }
  516. static inline unsigned long module_kallsyms_lookup_name(const char *name)
  517. {
  518. return 0;
  519. }
  520. static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
  521. struct module *,
  522. unsigned long),
  523. void *data)
  524. {
  525. return 0;
  526. }
  527. static inline int register_module_notifier(struct notifier_block *nb)
  528. {
  529. /* no events will happen anyway, so this can always succeed */
  530. return 0;
  531. }
  532. static inline int unregister_module_notifier(struct notifier_block *nb)
  533. {
  534. return 0;
  535. }
  536. #define module_put_and_exit(code) do_exit(code)
  537. static inline void print_modules(void)
  538. {
  539. }
  540. #endif /* CONFIG_MODULES */
  541. #ifdef CONFIG_SYSFS
  542. extern struct kset *module_kset;
  543. extern struct kobj_type module_ktype;
  544. extern int module_sysfs_initialized;
  545. #endif /* CONFIG_SYSFS */
  546. #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
  547. /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
  548. #define __MODULE_STRING(x) __stringify(x)
  549. #ifdef CONFIG_DEBUG_SET_MODULE_RONX
  550. extern void set_all_modules_text_rw(void);
  551. extern void set_all_modules_text_ro(void);
  552. #else
  553. static inline void set_all_modules_text_rw(void) { }
  554. static inline void set_all_modules_text_ro(void) { }
  555. #endif
  556. #ifdef CONFIG_GENERIC_BUG
  557. void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
  558. struct module *);
  559. void module_bug_cleanup(struct module *);
  560. #else /* !CONFIG_GENERIC_BUG */
  561. static inline void module_bug_finalize(const Elf_Ehdr *hdr,
  562. const Elf_Shdr *sechdrs,
  563. struct module *mod)
  564. {
  565. }
  566. static inline void module_bug_cleanup(struct module *mod) {}
  567. #endif /* CONFIG_GENERIC_BUG */
  568. #endif /* _LINUX_MODULE_H */