在原始文件中,并不支持SMP,因而也就没有per_cpu的问题,但在加上CONFIG_SMP之后,会有如下错误:
[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'__per_cpu_end [___per_cpu_end]' referenced from 'init.dlb[main.doj]'
'__per_cpu_start [___per_cpu_start]' referenced from 'init.dlb[main.doj]'
为此,我们需要在ldf文件的.init段中加上这样的语句:
//.percpu
INPUT_SECTION_ALIGN(64)
. = (. + 63) / 64 * 64;
__per_cpu_start = .;
INPUT_SECTIONS($LIBRARIES_CORE_A(.data.percpu))
__per_cpu_end = .;
时间: 2024-11-05 12:28:59