56xx_flash.ld 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /* Entry Point */
  2. ENTRY(_start)
  3. /* define heap and stack size */
  4. __HEAP_SIZE = 0 ;
  5. __STACK_SIZE = 4096 ;
  6. SRAM_SIZE = 192K;
  7. /* Define SRAM Base Address */
  8. SRAM_BASE_ADDR = 0x40000000;
  9. MEMORY
  10. {
  11. flash_rchw : org = 0x00000000, len = 0x08
  12. m_text : org = 0x1000, len = 3070K
  13. m_data : org = 0x40000000, len = 192K
  14. }
  15. SECTIONS
  16. {
  17. .rchw :
  18. {
  19. KEEP(*(.rchw))
  20. } > flash_rchw
  21. .startup : ALIGN(0x400)
  22. {
  23. __start = . ;
  24. *(.startup)
  25. } > m_text
  26. .core_exceptions_table : ALIGN(0x1000)
  27. {
  28. __IVPR_VALUE = . ;
  29. KEEP(*(.core_exceptions_table))
  30. } > m_text
  31. .intc_vector_table : ALIGN(0x1000)
  32. {
  33. KEEP(*(.intc_vector_table))
  34. } > m_text
  35. .text_booke :
  36. {
  37. INPUT_SECTION_FLAGS (!SHF_PPC_VLE)
  38. *(.text*)
  39. } > m_text
  40. .text_vle :
  41. { INPUT_SECTION_FLAGS (SHF_PPC_VLE)
  42. *(.text.startup)
  43. *(.text)
  44. *(.text.*)
  45. KEEP (*(.init))
  46. KEEP (*(.fini))
  47. . = ALIGN(16);
  48. } > m_text /* that will force pick VLE .text sections */
  49. .ctors :
  50. {
  51. __CTOR_LIST__ = .;
  52. /* gcc uses crtbegin.o to find the start of
  53. the constructors, so we make sure it is
  54. first. Because this is a wildcard, it
  55. doesn't matter if the user does not
  56. actually link against crtbegin.o; the
  57. linker won't look for a file to match a
  58. wildcard. The wildcard also means that it
  59. doesn't matter which directory crtbegin.o
  60. is in. */
  61. KEEP (*crtbegin.o(.ctors))
  62. KEEP (*crtbegin?.o(.ctors))
  63. /* We don't want to include the .ctor section from
  64. from the crtend.o file until after the sorted ctors.
  65. The .ctor section from the crtend file contains the
  66. end of ctors marker and it must be last */
  67. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
  68. KEEP (*(SORT(.ctors.*)))
  69. KEEP (*(.ctors))
  70. __CTOR_END__ = .;
  71. } > m_text
  72. .dtors :
  73. {
  74. __DTOR_LIST__ = .;
  75. KEEP (*crtbegin.o(.dtors))
  76. KEEP (*crtbegin?.o(.dtors))
  77. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
  78. KEEP (*(SORT(.dtors.*)))
  79. KEEP (*(.dtors))
  80. __DTOR_END__ = .;
  81. } > m_text
  82. .preinit_array :
  83. {
  84. PROVIDE_HIDDEN (__preinit_array_start = .);
  85. KEEP (*(.preinit_array*))
  86. PROVIDE_HIDDEN (__preinit_array_end = .);
  87. } > m_text
  88. .init_array :
  89. {
  90. PROVIDE_HIDDEN (__init_array_start = .);
  91. KEEP (*(SORT(.init_array.*)))
  92. KEEP (*(.init_array*))
  93. PROVIDE_HIDDEN (__init_array_end = .);
  94. } > m_text
  95. .fini_array :
  96. {
  97. PROVIDE_HIDDEN (__fini_array_start = .);
  98. KEEP (*(SORT(.fini_array.*)))
  99. KEEP (*(.fini_array*))
  100. PROVIDE_HIDDEN (__fini_array_end = .);
  101. } > m_text
  102. .rodata :
  103. {
  104. *(.rodata)
  105. *(.rodata.*)
  106. } > m_text
  107. .eh_frame_hdr : { *(.eh_frame_hdr) } > m_text
  108. .eh_frame : { KEEP (*(.eh_frame)) } > m_text
  109. .data :
  110. {
  111. *(.data)
  112. *(.data.*)
  113. } > m_data AT>m_text
  114. .sdata2 :
  115. {
  116. *(.sdata2)
  117. *(.sdata2.*)
  118. } > m_data AT>m_text
  119. .sbss2 (NOLOAD) :
  120. {
  121. /* _SDA2_BASE_ = .; */
  122. *(.sbss2)
  123. *(.sbss2.*)
  124. } > m_data
  125. .sdata :
  126. {
  127. *(.sdata)
  128. *(.sdata.*)
  129. } > m_data AT>m_text
  130. .bss (NOLOAD) :
  131. {
  132. __BSS_START = .;
  133. *(.sbss)
  134. *(.sbss.*)
  135. *(.bss)
  136. *(.bss.*)
  137. *(COMMON)
  138. __BSS_END = .;
  139. } > m_data
  140. .stack (NOLOAD) : ALIGN(16)
  141. {
  142. __HEAP = . ;
  143. PROVIDE (_end = . );
  144. PROVIDE (end = . );
  145. . += __HEAP_SIZE ;
  146. __HEAP_END = . ;
  147. _stack_end = . ;
  148. . += __STACK_SIZE ;
  149. _stack_addr = . ;
  150. __SP_INIT = . ;
  151. . += 4;
  152. } > m_data
  153. /*-------- LABELS USED IN CODE -------------------------------*/
  154. /* Labels for Copying Initialised Data from Flash to RAM */
  155. __DATA_SRAM_ADDR = ADDR(.data);
  156. __SDATA_SRAM_ADDR = ADDR(.sdata);
  157. __DATA_SIZE = SIZEOF(.data);
  158. __SDATA_SIZE = SIZEOF(.sdata);
  159. __DATA_ROM_ADDR = LOADADDR(.data);
  160. __SDATA_ROM_ADDR = LOADADDR(.sdata);
  161. /* Labels Used for Initialising SRAM ECC */
  162. __SRAM_SIZE = SRAM_SIZE;
  163. __SRAM_BASE_ADDR = SRAM_BASE_ADDR;
  164. __BSS_SIZE = __BSS_END - __BSS_START;
  165. }