some question about kendryte.ld in SDK



  • 1、
    PROVIDE( _rom_start = ORIGIN(rom) );
    PROVIDE( _rom_end = ORIGIN(rom) + LENGTH(rom) );
    these statements are in the head of linker.ld but no definition of "rom"

    2、in then end of linker.ld

    . = ALIGN(64);
    PROVIDE( _end = ABSOLUTE(.) );
    /* Leave 2 holes for stack & TLS, the size can set in kconfig */
    PROVIDE( _heap_start = ABSOLUTE(.) + _stack_size * 2 );
    PROVIDE( _tp0 = (_end + 63) & (-64) );
    PROVIDE( _tp1 = _tp0 + _stack_size );
    PROVIDE( _sp0 = _tp0 + _stack_size );
    PROVIDE( _sp1 = _tp1 + _stack_size );

    ". = ALIGN(64);":the memory location counter is aligned to 64 bytes boundary here and hence "_end" is aligned to 64 bytes boundary but why "PROVIDE( _tp0 = (_end + 63) & (-64) );" align 64 bytes boundary again?

    3、Why memory map is like this:?
    0_1573065804090_a1d623be-f4f9-45c4-beb6-bb3c2c743fd0-image.png

    the locations of "_tp1" and "_sp0" are same and the locations of "_sp1" and "_heap_start" are same.
    Isn't "_sp0"(stack pointer 0) and "_tp0"(thread pointer 0) for core 0 and "_sp1" and "_tp1" for core1?