link.cmd 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. -heap 0x6000000 /* 堆空间大小,设置堆大小为0x600000个字节 */ /* 0x1000 4KB 0x10000 64KB 0x100000 1M 0x1000000 16M 0x10000000 256M */
  2. -stack 0x6000000 /* 栈空间大小,设置栈大小为0x600000个字节 */ /* 0x20000 128KB 0x40000 256KB 0x400000 4M */
  3. MEMORY /* 描述系统实际的硬件资源 */
  4. {
  5. /* o:original,表示起始地址 l:length,表示存储区长度(以字节为单位) LOCAL_L1P_SRAM:表示对相对独立的存储空间进行标记 */
  6. /* Local L1P L1D */
  7. LOCAL_L1P_SRAM: o = 0x00E00000 l = 0x00008000 /* 32kB LOCAL L1P/SRAM */
  8. LOCAL_L1D_SRAM: o = 0x00F00000 l = 0x00008000 /* 32kB LOCAL L1D/SRAM */
  9. /* Local L2, 0.5~1MB*/
  10. LOCAL_L2_SRAM: o = 0x00800000 l = 0x00080000 /* 512kB LOCAL L2/SRAM */
  11. /*
  12. VECTORS: o = 0x00800000 l = 0x00000200
  13. LL2_RW_DATA: o = 0x00800200 l = 0x0003FE00
  14. */
  15. /* Multicore shared Memory */
  16. SHRAM: o = 0x0C000000 l = 0x00400000 /* 4MB Multicore shared Memmory */
  17. /* EMIF Memory */
  18. /* EMIF16_CS2: o = 0x70000000 l = 0x04000000 */ /* 64MB EMIF16 CS2 Data Memory */
  19. /* EMIF16_CS3: o = 0x74000000 l = 0x04000000 */ /* 64MB EMIF16 CS3 Data Memory */
  20. /* EMIF16_CS4: o = 0x78000000 l = 0x04000000 */ /* 64MB EMIF16 CS4 Data Memory */
  21. /* EMIF16_CS5: o = 0x7C000000 l = 0x04000000 */ /* 64MB EMIF16 CS5 Data Memory */
  22. /* External DDR3, upto 2GB per core */
  23. CORE0_DDR3: o = 0x80000000 l = 0x10000000 /* 256MB DDR3 SDRAM for CORE0 */
  24. /* DDR3_CODE: o = 0x80000000 l = 0x01000000 */ /*set memory protection attribitue as execution only*/
  25. /* DDR3_R_DATA: o = 0x81000000 l = 0x01000000 */ /*set memory protection attribitue as read only*/
  26. /* DDR3_RW_DATA: o = 0x82000000 l = 0x20000000 */ /*set memory protection attribitue as read/write*/
  27. }
  28. SECTIONS /* 描述“段”如何定位 */
  29. {
  30. .text > CORE0_DDR3 /* 存放程序代码 */
  31. .cinit > CORE0_DDR3 /* 存放程序中的变量初值和常量 */
  32. .pinit > CORE0_DDR3 /* 全局构造器(C++)程序列表,全局对象的构造函数表,代码 */
  33. .const > CORE0_DDR3 /* 存放程序中的字符常量、浮点常量和用const声明的常量 */
  34. .switch > CORE0_DDR3 /* 存放程序中switch语句的跳转地址表 */
  35. .stack > CORE0_DDR3 /* 为程序系统堆栈保留存储空间,用于保存返回地址、函数间的参数传递、存储局部变量和保存中间结果 */
  36. .tdata > CORE0_DDR3
  37. GROUP
  38. {
  39. .neardata
  40. .rodata /* */
  41. .bss /* 为程序中的全局和静态变量保留存储空间 */
  42. } > CORE0_DDR3
  43. .far > CORE0_DDR3 /* 为程序中用far声明的全局和静态变量保留空间 */
  44. .fardata > CORE0_DDR3 /* */
  45. .cio > CORE0_DDR3 /* */
  46. .sysmem > CORE0_DDR3 /* 用于程序中的malloc、calloc和realoc函数动态分配存储空间 */
  47. .init_array > CORE0_DDR3
  48. .c6xabi.extab > CORE0_DDR3
  49. .c6xabi.exidx > CORE0_DDR3
  50. .TI.tls_init > CORE0_DDR3
  51. }