Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

linux-y3pi:/usr/src/linux-2.6.38.8 # 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:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
share|improve this question
    
Probably duplicate of stackoverflow.com/questions/6807766/… –  Ulrich Dangel Jun 8 '12 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? –  Lai Jiangshan Jul 31 '12 at 3:37
    
@LaiJiangshan Or merge that answer with this one? –  TheIndependentAquarius Jul 31 '12 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!

Reference


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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.