56xx_ram.ld 4.1 KB

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