OSDN Git Service

powerpc: module: handle MODVERSION for .TOC.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 18 Mar 2014 09:29:11 +0000 (19:59 +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.".  If we
don't create a CRC for it (minus the leading ".", since we strip that)
we get a modpost warning about missing CRC and the CRC array seems to
be displaced by 1 so other CRCs mismatch too.

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

index b80fafb..4e314b9 100644 (file)
@@ -637,6 +637,15 @@ _GLOBAL(kexec_sequence)
 
 #ifdef CONFIG_MODULES
 #if defined(_CALL_ELF) && _CALL_ELF == 2
+
+#ifdef CONFIG_MODVERSIONS
+.weak __crc_TOC.
+.section "___kcrctab+TOC.","a"
+.globl __kcrctab_TOC.
+__kcrctab_TOC.:
+       .llong  __crc_TOC.
+#endif
+
 /*
  * 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.