Kernel: section mismatches

What are these things? How serious are they?

I noticed warning messages about "section mismatches" when I compiled some 3rd-party drivers with an SMP-enabled kernel. I think the Lucent driver is one of them -- it compiled ok with a uniprocessor kernel, but the same kernel version configured for SMP gave the "section mismatches" warning. Note that the Lucent driver does not work with an SMP kernel, but I don't know if that has anything to do with the mismatch warning.

The 'agsrm' modem driver also has this warning.

Today I compiled the 2.6.27.29 kernel, SMP-enabled, and I noticed that even the kernel reports a mismatch:

WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'


I recompiled the kernel:

# make CONFIG_DEBUG_SECTION_MISMATCH=y bzImage

Which reports this:

MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x91e): Section mismatch in reference from the function cpu_exit_clear() to the function .cpuinit.text:cpu_uninit()
The function cpu_exit_clear() references
the function __cpuinit cpu_uninit().
This is often because cpu_exit_clear lacks a __cpuinit
annotation or the annotation of cpu_uninit is wrong.

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.


Is this something to worry about? The kernel seems to work ok. What about modules, if they give that warning is it a problem? For example, compiling the agsrm modem driver:

Building modules, stage 2.
MODPOST 2 modules
WARNING: modpost: Found 3 section mismatch(es).


google search
I typed these keywords "modpost section mismatch kernel" and got 129,000 hits. Some people get a dozen or more mismatches -- perhaps I should count myself lucky! Here is one comment (http://bugs.gentoo.org/232335):

Section matches are generally harmless and are in many kernel versions and seem
to come and go.


If I narrow the search a bit, "modpost section mismatch cpu_exit_clear initial_code", I get just 7 hits, most of them for the 2.6.27.x kernel. Nothing that tells me whether it is a "serious" problem, no patches to fix it.

I'm curious, tonight I'll recompile the kernel for a single-processor only, see if that fixes it.


Posted on 7 Aug 2009, 18:32


Comments:

Posted on 8 Aug 2009, 2:20 by MU
warnings
Hi Barry,
in general warnings during compilation are harmless.

They may appear for example, if deprciated functions are used.
I often had them with Gtk, and they caused no trouble.
Really serious things throw errors, and compilation then stops.

Mark


Posted on 8 Aug 2009, 8:05 by BarryK
Section mismatches
Interesting, I reconfigured the kernel, just one change, unticked the SMP checkbox, then when I compiled it was reduced to one section mismatch.

Anyway, I'll go back to SMP for this kernel.

I notice that the help while configuring refers to 'ext4dev' filesystem that "will be renamed to ext4 when it matures" (or words to that effect).

But, the 2.6.27 kernel was released August 2008 and has been patched continuously since then, right up to the latest '29' patch on 30th July 2009. I read some recent changelogs, lots of upgrades for ext4.

There are some questions about this on various forums. People reporting that they have to mount the partition as 'ext4dev' rather than 'ext4'. There are some comments that even in the 2.6.28 kernel ext4 is not fully mature, but they are dated around December 2008.

Oh, Redhat has a patch for 2.6.27.29 to rename ext4dev to ext4:
https://www.redhat.com/archives/fedora-package-announce/2009-August/msg00166.html
...I'll check that out.



Posted on 8 Aug 2009, 8:29 by BarryK
ext4dev again
For the record, I looked at the 2.6.27.x changelogs, there were lots of ext4 patches in 2.6.27.25, 2.6.27.20 and 2.6.27.19 (I looked back as far as 2.6.27.13) -- and in the changelog they are referring to it as 'ext4'.

But the actual configure docs call it ext4dev, so I will probably have to apply the patch.



Posted on 8 Aug 2009, 8:49 by BarryK
ext4dev yet again
I searched the changelog, back to 2.6.27.1, there are lots of ext4 patches in 2.6.27.8, but nothing anywhere about renaming ext4dev to ext4.



Posted on 8 Aug 2009, 8:07 by BarryK
ext3dev patch
The patch is 'linux-2.6.27-ext4-rename-ext4dev-to-ext4.patch' (created by Redhat/Fedora) but finding where to download it from, that is a problem...



Posted on 8 Aug 2009, 9:06 by BarryK
ext4dev patch
Ah ha! here's a patch:

http://osdir.com/ml/anaconda-devel-list/2009-07/msg00256.html



Posted on 8 Aug 2009, 18:34 by Dougal
Section Mismatch
This (or one instance) was fixed recently in lkml:
http://lkml.org/lkml/2008/1/19/134

It has to do with CONFIG_CPU_HOTPLUG.