kernel section mismatch

Bruce Dubbs bruce.dubbs at gmail.com
Tue Dec 23 03:14:20 MST 2008


I've been getting a warning when building the kernel (2.6.27.4):

WARNING: vmlinux.o(.cpuinit.data+0x0): Section mismatch in reference
from the variable initial_code to the function
.init.text:i386_start_kernel()
The variable __cpuinitdata initial_code references
a function __init i386_start_kernel().
If i386_start_kernel is only used by initial_code then
annotate i386_start_kernel with a matching annotation.

After doing some googling, I found a patch:

--- arch/x86/kernel/head_32.S.orig      2008-10-14 17:04:39.000000000 -0500
+++ arch/x86/kernel/head_32.S   2008-10-14 17:03:12.000000000 -0500
@@ -600,6 +600,7 @@

  .section .cpuinit.data,"wa"
  .align 4
+__REFDATA
  ENTRY(initial_code)
         .long i386_start_kernel


Evidently only some combinations of options triggers the warning.  The above 
patch fixed it for me.

   -- Bruce


More information about the lfs-dev mailing list