添加完head.s后有几个链接错误:
[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'__bss_start [___bss_start]' referenced from 'corea.dlb[head.doj]'
'__bss_stop [___bss_stop]' referenced from 'corea.dlb[head.doj]'
其中
__bss_start和
__bss_stop在vmlinus.lds中定义:
.bss :
{
. = ALIGN(4);
___bss_start = .;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(4);
___bss_stop = .;
__end = .;
}
它就是一个指向.bss段开头的整数,我们需要在LDF中修改相应的定义:
bsz_sdram ZERO_INIT
{
INPUT_SECTION_ALIGN(4)
. = (. + 3) / 4 * 4;
___bss_start = .;
INPUT_SECTIONS($OBJECTS_CORE_A(sdram_bsz) $LIBRARIES_CORE_A(sdram_bsz))
INPUT_SECTIONS($LIBRARIES_CORE_A(.bss .bss.*))
INPUT_SECTIONS($LIBRARIES_CORE_A(COMMON))
INPUT_SECTION_ALIGN(4)
. = (. + 3) / 4 * 4;
___bss_stop = .;
__end = .;
} > MEM_SDRAM