2013-10-29 35 views

回答

2

__cpuinit實際上告訴編譯器將函數放入指定的elf部分。

#define __cpuinit  __section(.cpuinit.text) __cold 

內核代碼中說在include/linux/init.h中:

/* modpost check for section mismatches during the kernel build. 
* A section mismatch happens when there are references from a 
* code or data section to an init section (both code or data). 
* The init sections are (for most archs) discarded by the kernel 
* when early init has completed so all such references are potential bugs. 
* For exit sections the same issue exists. ......