summaryrefslogtreecommitdiff
path: root/include/linux/export.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2017-02-20 20:24:00 +0300
committerJ. Bruce Fields <bfields@redhat.com>2017-02-21 01:20:05 +0300
commit60709c093ed39aadb0f09972ebbc96dc34eb372e (patch)
tree983681311986070971d3756d9f8e75868aa7bb9a /include/linux/export.h
parent7323f0d2881bbd426ce6bc0a956ef9e739ffe767 (diff)
parent0839ffb83e44e5ff1843e932592525fc2bff23ff (diff)
downloadlinux-60709c093ed39aadb0f09972ebbc96dc34eb372e.tar.xz
nfsd: merge stable fix into main nfsd branch
Diffstat (limited to 'include/linux/export.h')
-rw-r--r--include/linux/export.h17
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;
#ifdef CONFIG_MODVERSIONS
/* Mark the CRC weak since genksyms apparently decides not to
* generate a checksums for some symbols */
+#if defined(CONFIG_MODULE_REL_CRCS)
#define __CRC_SYMBOL(sym, sec) \
- extern __visible void *__crc_##sym __attribute__((weak)); \
- static const unsigned long __kcrctab_##sym \
- __used \
- __attribute__((section("___kcrctab" sec "+" #sym), used)) \
- = (unsigned long) &__crc_##sym;
+ asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
+ " .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
+ " .long " VMLINUX_SYMBOL_STR(__crc_##sym) " - . \n" \
+ " .previous \n");
+#else
+#define __CRC_SYMBOL(sym, sec) \
+ asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
+ " .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
+ " .long " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
+ " .previous \n");
+#endif
#else
#define __CRC_SYMBOL(sym, sec)
#endif