DSP

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(19):_stext

2019-07-13 15:49发布

  快乐虾 http://blog.csdn.net/lights_joy/ lights@hb165.com   本文适用于 ADI bf561 DSP 优视BF561EVB开发板 uclinux-2008r1.5-rc3(smp patch) Visual DSP++ 5.0(update 5)    欢迎转载,但请保留作者信息   看看到目前为止还有几个error [Error li1021]  The following symbols referenced in processor 'p0' could not be resolved:         '_stext [__stext]' referenced from 'corea.dlb[head.doj]'         'bf53x_relocate_l1_mem [_bf53x_relocate_l1_mem]' referenced from 'corea.dlb[head.doj]'         'cmdline_init [_cmdline_init]' referenced from 'corea.dlb[head.doj]'         'init_pda [_init_pda]' referenced from 'corea.dlb[head.doj]'         'init_thread_union [_init_thread_union]' referenced from 'corea.dlb[head.doj]'         'start_kernel [_start_kernel]' referenced from 'corea.dlb[head.doj]' 下面开始解决_stext的问题。 先看看head.s中对_stext的使用:        /* In case there is a NULL pointer reference         * Zero out region before stext         */          p1.l = 0x0;        p1.h = 0x0;        r0.l = __stext;        r0.h = __stext;        r0 = r0 >> 1;        p2 = r0;        r0 = 0;        lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2; .L_clear_zero:        W[p1++] = r0; 这段代码的用意在于将代码段之前的SDRAM空间清0。在vmlinux.lds.s中将_stext定义为指向代码段的首地址,如下所示:        .text :        {               __text = .;               _text = .;               __stext = .;               TEXT_TEXT               SCHED_TEXT               LOCK_TEXT               KPROBES_TEXT               *(.text.*)               *(.fixup)                 . = ALIGN(16);               ___start___ex_table = .;               *(__ex_table)               ___stop___ex_table = .;                 . = ALIGN(4);               __etext = .;        } 相应地我们要在LDF文件中添加内容,还是先给代码段定义空间:    MEM_UCLINUX_TEXT        { TYPE(RAM) START(0x00010000) END(0x0001ffff) WIDTH(8) }    MEM_UCLINUX_DATA        { TYPE(RAM) START(0x00020000) END(0x0002ffff) WIDTH(8) }    MEM_UCLINUX_BSS         { TYPE(RAM) START(0x00030000) END(0x0003ffff) WIDTH(8) }    MEM_SDRAM_BANK0         { TYPE(RAM) START(0x00040000) END(0x00ffffff) WIDTH(8) }    MEM_SDRAM_BANK1         { TYPE(RAM) START(0x01000000) END(0x01ffffff) WIDTH(8) }    MEM_SDRAM_BANK2         { TYPE(RAM) START(0x02000000) END(0x02ffffff) WIDTH(8) }    MEM_SDRAM_BANK3         { TYPE(RAM) START(0x03000000) END(0x03ffffff) WIDTH(8) } 接下来在p0里面定义text段:         uclinux_text         {               __text = .;               _text = .;               __stext = .;   /*                                       TEXT_TEXT               SCHED_TEXT               LOCK_TEXT               KPROBES_TEXT               *(.text.*)               *(.fixup)                 . = ALIGN(16);               ___start___ex_table = .;               *(__ex_table)               ___stop___ex_table = .; */          INPUT_SECTION_ALIGN(4)                __etext = .;         } > MEM_UCLINUX_TEXT 内容暂时为空,后面根据需要添加。 看看还有几个error [Error li1021]  The following symbols referenced in processor 'p0' could not be resolved:         'bf53x_relocate_l1_mem [_bf53x_relocate_l1_mem]' referenced from 'corea.dlb[head.doj]'         'cmdline_init [_cmdline_init]' referenced from 'corea.dlb[head.doj]'         'init_pda [_init_pda]' referenced from 'corea.dlb[head.doj]'         'init_thread_union [_init_thread_union]' referenced from 'corea.dlb[head.doj]'         'start_kernel [_start_kernel]' referenced from 'corea.dlb[head.doj]'  

1       参考资料

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(1):前言(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(2):代码注释(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(3):vdsp项目创建(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(4):目录差异(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(5):'bf561.h'的问题(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(6)CONFIG_BFIN_KERNEL_CLOCK(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(7)CONFIG_MEM_MT48LC16M16A2TG_75(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(8):CONFIG_CLKIN_HZ(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(9):CONFIG_MEM_SIZE(2009-1-12) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(10):CONFIG_FLASH_SPEED_BTT(2009-1-13) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(11):__INIT(2009-1-13) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(12):trace_buffer_init(2009-1-13) uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(13):ENDPROC(2009-1-13) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(14)__FINIT(2009-1-13) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(15)CONFIG_BANK_x(2009-1-13) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(16):使用head.s做为入口点(2009-1-13) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(17)__bss_start(2009-1-13) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(18)_sdata(2009-1-14)