_linkcmds 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* memory-config builder in ACoreIDE by qxbin*/
  2. /*21 Mar 2025 10:47:48 GMT*/
  3. ENTRY(_start)
  4. MEMORY
  5. {
  6. ram : ORIGIN = 0x80000000, LENGTH = 0x03000000
  7. boot_rom : ORIGIN = 0x700000, LENGTH = 0x00200000
  8. }
  9. SECTIONS {
  10. .vector ((0x80000000 + (0x00001000-1))& ~ (0x00001000-1)) : AT((0x701000 + (0x00001000-1))& ~ (0x00001000-1))
  11. {
  12. ".vector_start" = .;
  13. _vectors_start = .;
  14. *(.vectors);
  15. . = ALIGN(4096);
  16. ;
  17. _vectors_end = .;
  18. } >ram
  19. _vectors_size = 0x00008000;
  20. .text ((".vector_start" + 0x00008000 + (0x00001000-1))& ~ (0x00001000-1)) : AT((0x701000 + 0x00008000 + (0x00001000-1))& ~ (0x00001000-1))
  21. {
  22. ".text_start" = .;
  23. _code_start = .;
  24. CREATE_OBJECT_SYMBOLS *( .text ) ;
  25. *(.m_hdr) ;
  26. __EH_FRAME_BEGIN__ = .;
  27. *(.eh_frame) ;
  28. *(.gnu.linkonce.t*) ;
  29. . = ALIGN(4);
  30. ___CTOR_LIST__ = .;
  31. __CTOR_LIST__ = .;
  32. LONG (-1);
  33. *(.ctors);
  34. *(.ctor);
  35. LONG (0);
  36. __CTOR_END__ = .;
  37. ___DTOR_LIST__ = .;
  38. __DTOR_LIST__ = .;
  39. LONG (-1);
  40. *(.dtors);
  41. *(.dtor);
  42. LONG (0);
  43. __DTOR_END__ = .;
  44. *(.gnu.linkonce.r*);
  45. *(.glue_7) ;
  46. *(.glue_7t);
  47. *(.rodata);
  48. *(.rodata.*);
  49. *(.init);
  50. *(.jcr);
  51. *(.data.rel.local);
  52. *(.fini);
  53. *(.got*);
  54. *(.fixup);
  55. *(.interface);
  56. . = ALIGN(4096);
  57. ;
  58. _code_end = .;
  59. } >ram
  60. _code_size = SIZEOF(.text);
  61. .data ((".text_start" + "_code_size" + (0x00001000-1))& ~ (0x00001000-1)) : AT((0x701000 + 0x00008000 + "_code_size" + (0x00001000-1))& ~ (0x00001000-1))
  62. {
  63. ".data_start" = .;
  64. _data_start = .;
  65. *(.data);
  66. *(.gnu.linkonce.d*);
  67. *(.sdata*);
  68. *(.flash*);
  69. *(.gcc_except_table);
  70. *(.init_array*);
  71. *(.fini_array*);
  72. . = ALIGN(4);
  73. shell_cmd_start = .;
  74. *(.data.shellCmd) ;
  75. shell_cmd_end = .;
  76. . = ALIGN(4096);
  77. ;
  78. _data_end = .;
  79. } >ram
  80. _data_size = SIZEOF(.data);
  81. .exidx ((".data_start" + "_data_size" + (0x00001000-1))& ~ (0x00001000-1)) : AT((0x701000 + 0x00008000 + "_code_size" + "_data_size" + (0x00001000-1))& ~ (0x00001000-1))
  82. {
  83. ".exidx_start" = .;
  84. _exidx_start = .;
  85. *(.ARM.exidx* .gnu.linkonce.armexidx.*);
  86. _exidx_end = .;
  87. } >ram
  88. _exidx_size = SIZEOF(.exidx);
  89. .bss ((".exidx_start" + "_exidx_size" + (0x00001000-1))& ~ (0x00001000-1)) :
  90. {
  91. ".bss_start" = .;
  92. _bss_start = .;
  93. *(.bss);
  94. *(COMMON);
  95. *(.sbss);
  96. . = ALIGN(4096);
  97. ;
  98. _bss_end = .;
  99. } >ram
  100. _bss_size = SIZEOF(.bss);
  101. _pgheap_start =( 0x80200000 + (0x00000004-1))& ~ (0x00000004-1);
  102. _pgheap_end =( 0x80200000 + 0x500000 + (0x00000004-1))& ~ (0x00000004-1);
  103. _pgheap_size = 0x500000;
  104. _crtl_heap_start =( 0x80700000 + (0x00000004-1))& ~ (0x00000004-1);
  105. _crtl_heap_end =( 0x80700000 + 0x02900000 + (0x00000004-1))& ~ (0x00000004-1);
  106. _crtl_heap_size = 0x02900000;
  107. _rom_start_start = ((0x700000 + (0x00001000-1))& ~ (0x00001000-1));
  108. _rom_start_end = ((0x700000 + 0x1000 + (0x00001000-1))& ~ (0x00001000-1));
  109. _rom_vectors_start = ((0x701000 + (0x00001000-1))& ~ (0x00001000-1));
  110. _rom_vectors_end = ((0x701000 + 0x00008000 + (0x00001000-1))& ~ (0x00001000-1));
  111. _rom_code_start = ((0x701000 + 0x00008000 + (0x00001000-1))& ~ (0x00001000-1));
  112. _rom_code_end = ((0x701000 + 0x00008000 + "_code_size" + (0x00001000-1))& ~ (0x00001000-1));
  113. _rom_data_start = ((0x701000 + 0x00008000 + "_code_size" + (0x00001000-1))& ~ (0x00001000-1));
  114. _rom_data_end = ((0x701000 + 0x00008000 + "_code_size" + "_data_size" + (0x00001000-1))& ~ (0x00001000-1));
  115. _rom_exidx_start = ((0x701000 + 0x00008000 + "_code_size" + "_data_size" + (0x00001000-1))& ~ (0x00001000-1));
  116. _rom_exidx_end = ((0x701000 + 0x00008000 + "_code_size" + "_data_size" + "_exidx_size" + (0x00001000-1))& ~ (0x00001000-1));
  117. .start ((0x700000 + (0x00001000-1))& ~ (0x00001000-1)) : AT((0x700000 + (0x00001000-1))& ~ (0x00001000-1))
  118. {
  119. ".start_start" = .;
  120. _start_start = .;
  121. *(.start);
  122. . = ALIGN(4096);
  123. ;
  124. _start_start = .;
  125. } >boot_rom
  126. _start_size = 0x1000;
  127. }
  128. load__code_start =( 0x00001000-1 )&~(0x00001000 -1 );
  129. load__data_start =( load__code_start + _code_size + ( 0x00001000 -1 ))&~(0x00001000 -1 );
  130. load__bss_start =( load__data_start + _data_size + ( 0x00001000 -1 ))&~(0x00001000 -1 );