diff options
Diffstat (limited to 'include/linux/export.h')
-rw-r--r-- | include/linux/export.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/export.h b/include/linux/export.h index 2a0f61fbc731..1a1dfdb2a5c6 100644 --- a/include/linux/export.h +++ b/include/linux/export.h | |||
@@ -43,12 +43,19 @@ extern struct module __this_module; | |||
43 | #ifdef CONFIG_MODVERSIONS | 43 | #ifdef CONFIG_MODVERSIONS |
44 | /* Mark the CRC weak since genksyms apparently decides not to | 44 | /* Mark the CRC weak since genksyms apparently decides not to |
45 | * generate a checksums for some symbols */ | 45 | * generate a checksums for some symbols */ |
46 | #if defined(CONFIG_MODULE_REL_CRCS) | ||
46 | #define __CRC_SYMBOL(sym, sec) \ | 47 | #define __CRC_SYMBOL(sym, sec) \ |
47 | extern __visible void *__crc_##sym __attribute__((weak)); \ | 48 | asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \ |
48 | static const unsigned long __kcrctab_##sym \ | 49 | " .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \ |
49 | __used \ | 50 | " .long " VMLINUX_SYMBOL_STR(__crc_##sym) " - . \n" \ |
50 | __attribute__((section("___kcrctab" sec "+" #sym), used)) \ | 51 | " .previous \n"); |
51 | = (unsigned long) &__crc_##sym; | 52 | #else |
53 | #define __CRC_SYMBOL(sym, sec) \ | ||
54 | asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \ | ||
55 | " .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \ | ||
56 | " .long " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \ | ||
57 | " .previous \n"); | ||
58 | #endif | ||
52 | #else | 59 | #else |
53 | #define __CRC_SYMBOL(sym, sec) | 60 | #define __CRC_SYMBOL(sym, sec) |
54 | #endif | 61 | #endif |