Is this error message something that I should be worried about?

linux-y3pi:/usr/src/linux- # make modules
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 2516 modules
***WARNING: modpost: Found 10 section mismatch(es).***
To see full details build your kernel with:
  • Probably duplicate of stackoverflow.com/questions/6807766/… Jun 8, 2012 at 14:14
  • @UlrichDangel That's very good answer for this question, but how to handle this question? Close it for duplicated or Leave it as a high voted unanswered question(4 votes is high in unix.SE) or somethings else? Jul 31, 2012 at 3:37
  • @LaiJiangshan Or merge that answer with this one? Jul 31, 2012 at 4:06

1 Answer 1


Pure copy from this SO Q&A, A solution to this question is of valuable to U&L as well!


This is just a warning. The kernel build systems did a sanity check and found out something that might be an error. The warning message says somewhere in kernel code there is code that might do inappropriate cross section access. Note that your kernel did build!

To understand what the warning means, consider the following example:

Some kernel code in the kernel text section might be trying to call a function marked with the __init data macro, which the linker puts in the kernel init section that gets de-allocated after boot or module loading.

This might be a run time error since if the code in the text section calls the code in the init section after the initialization code has finished, it is basically calling a stale pointer.

Having said that, that call may be perfectly fine - it is possible that the calls in the kernel text section has some good reason to know that it only calls the function in the init section when it is guaranteed to be there.

This, of course, is just an example. Similar other scenarios also exists.

The solution is to compile with CONFIG_DEBUG_SECTION_MISMATCH=y which will give you output of what function is trying to access which data or function and which section they belong to. You can then try to figure out if the build time warning is warranted and if so hopefully fix.

The init.h macros __ref and __refdata can be used to allow such init references without warnings. For example,

char * __init_refok bar(void) 
  static int flag = 0;
  static char* rval = NULL;
  if(!flag) {
     flag = 1;
     rval = init_fn(); /* a function discarded after init */
  return rval;

__init_refok, etc can fix "valid" instances, so the fact they exist may not inspire confidence.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .