|
24 | 24 | .long sym |
25 | 25 | #endif |
26 | 26 |
|
27 | | -#define ___EXPORT_SYMBOL(sym, license, ns) \ |
| 27 | +/* |
| 28 | + * LLVM intregrated assembler refuses to merge adjacent string literals (like |
| 29 | + * C and GNU-as) and chokes on: |
| 30 | + * |
| 31 | + * .asciz "MODULE_" "kvm" ; |
| 32 | + * |
| 33 | + * As would be generated when using EXPORT_SYMBOL_GPL_FOR(foo, "kvm"), use |
| 34 | + * varargs to assemble it like so: |
| 35 | + * |
| 36 | + * .ascii "MODULE_", "kvm", "\0" ; |
| 37 | + * |
| 38 | + */ |
| 39 | +#define ___EXPORT_SYMBOL(sym, license, ns...) \ |
28 | 40 | .section ".export_symbol","a" ASM_NL \ |
29 | 41 | __export_symbol_##sym: ASM_NL \ |
30 | 42 | .asciz license ASM_NL \ |
31 | | - .asciz ns ASM_NL \ |
| 43 | + .ascii ns, "\0" ASM_NL \ |
32 | 44 | __EXPORT_SYMBOL_REF(sym) ASM_NL \ |
33 | 45 | .previous |
34 | 46 |
|
|
39 | 51 | * be reused in other execution contexts such as the UEFI stub or the |
40 | 52 | * decompressor. |
41 | 53 | */ |
42 | | -#define __EXPORT_SYMBOL(sym, license, ns) |
| 54 | +#define __EXPORT_SYMBOL(sym, license, ns...) |
43 | 55 |
|
44 | 56 | #elif defined(__GENKSYMS__) |
45 | 57 |
|
46 | | -#define __EXPORT_SYMBOL(sym, license, ns) __GENKSYMS_EXPORT_SYMBOL(sym) |
| 58 | +#define __EXPORT_SYMBOL(sym, license, ns...) __GENKSYMS_EXPORT_SYMBOL(sym) |
47 | 59 |
|
48 | 60 | #elif defined(__ASSEMBLY__) |
49 | 61 |
|
50 | | -#define __EXPORT_SYMBOL(sym, license, ns) \ |
| 62 | +#define __EXPORT_SYMBOL(sym, license, ns...) \ |
51 | 63 | ___EXPORT_SYMBOL(sym, license, ns) |
52 | 64 |
|
53 | 65 | #else |
54 | 66 |
|
55 | | -#define __EXPORT_SYMBOL(sym, license, ns) \ |
| 67 | +#define __EXPORT_SYMBOL(sym, license, ns...) \ |
56 | 68 | extern typeof(sym) sym; \ |
57 | 69 | __ADDRESSABLE(sym) \ |
58 | 70 | asm(__stringify(___EXPORT_SYMBOL(sym, license, ns))) |
|
70 | 82 | #define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", ns) |
71 | 83 | #define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "GPL", ns) |
72 | 84 |
|
| 85 | +#define EXPORT_SYMBOL_GPL_FOR(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "MODULE_", mods) |
| 86 | + |
73 | 87 | #endif /* _LINUX_EXPORT_H */ |
0 commit comments