]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
powerpc: EXPORT_SYMBOL(.TOC.)
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 18 Mar 2014 07:07:28 +0000 (17:37 +1030)
committerAnton Blanchard <anton@samba.org>
Wed, 23 Apr 2014 00:05:28 +0000 (10:05 +1000)
For the ELFv2 ABI, powerpc introduces a magic symbol ".TOC.".  depmod
then complains that this doesn't resolve (so does modpost, but we could
easily fix that).  To export this, we need to use asm.

modpost and depmod both strip "." from symbols for the old PPC64 ELFv1
ABI, so we actually export a "TOC.".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
arch/powerpc/kernel/misc_64.S

index bda85a193abf611a4134f44e79cbc1186484e016..b80fafbfab2f5e7b61f871d1e96b26d5e1bf7eec 100644 (file)
@@ -634,3 +634,22 @@ _GLOBAL(kexec_sequence)
        li      r5,0
        blr     /* image->start(physid, image->start, 0); */
 #endif /* CONFIG_KEXEC */
+
+#ifdef CONFIG_MODULES
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+/*
+ * Export a fake .TOC. since both modpost and depmod will complain otherwise.
+ * Both modpost and depmod strip the leading . so we do the same here.
+ */
+.section "__ksymtab_strings","a"
+__kstrtab_TOC.:
+       .asciz "TOC."
+
+.section "___ksymtab+TOC.","a"
+/* This symbol name is important: it's used by modpost to find exported syms */
+.globl __ksymtab_TOC.
+__ksymtab_TOC.:
+       .llong 0 /* .value */
+       .llong __kstrtab_TOC.
+#endif /* ELFv2 */
+#endif /* MODULES */