You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
3.1 KiB

  1. /* SECTIONS for non-volatile chip configuration, i.e. chips with flash */
  2. SECTIONS
  3. {
  4. .init :
  5. {
  6. KEEP (*(SORT_NONE(.init)))
  7. } >rom
  8. .text :
  9. {
  10. *(.text.unlikely .text.unlikely.*)
  11. *(.text.startup .text.startup.*)
  12. *(.text .text.*)
  13. *(.gnu.linkonce.t.*)
  14. } >rom
  15. .fini :
  16. {
  17. KEEP (*(SORT_NONE(.fini)))
  18. } >rom
  19. PROVIDE (__etext = .);
  20. PROVIDE (_etext = .);
  21. PROVIDE (etext = .);
  22. .rodata :
  23. {
  24. *(.rdata)
  25. *(.rodata .rodata.*)
  26. *(.gnu.linkonce.r.*)
  27. . = ALIGN(8);
  28. *(.srodata.cst16)
  29. *(.srodata.cst8)
  30. *(.srodata.cst4)
  31. *(.srodata.cst2)
  32. *(.srodata .srodata.*)
  33. } >rom
  34. . = ALIGN(4);
  35. .preinit_array :
  36. {
  37. PROVIDE_HIDDEN (__preinit_array_start = .);
  38. KEEP (*(.preinit_array))
  39. PROVIDE_HIDDEN (__preinit_array_end = .);
  40. } >rom
  41. .init_array :
  42. {
  43. PROVIDE_HIDDEN (__init_array_start = .);
  44. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  45. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  46. PROVIDE_HIDDEN (__init_array_end = .);
  47. } >rom
  48. .fini_array :
  49. {
  50. PROVIDE_HIDDEN (__fini_array_start = .);
  51. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  52. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  53. PROVIDE_HIDDEN (__fini_array_end = .);
  54. } >rom
  55. .ctors :
  56. {
  57. /* gcc uses crtbegin.o to find the start of
  58. the constructors, so we make sure it is
  59. first. Because this is a wildcard, it
  60. doesn't matter if the user does not
  61. actually link against crtbegin.o; the
  62. linker won't look for a file to match a
  63. wildcard. The wildcard also means that it
  64. doesn't matter which directory crtbegin.o
  65. is in. */
  66. KEEP (*crtbegin.o(.ctors))
  67. KEEP (*crtbegin?.o(.ctors))
  68. /* We don't want to include the .ctor section from
  69. the crtend.o file until after the sorted ctors.
  70. The .ctor section from the crtend file contains the
  71. end of ctors marker and it must be last */
  72. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  73. KEEP (*(SORT(.ctors.*)))
  74. KEEP (*(.ctors))
  75. } >rom
  76. .dtors :
  77. {
  78. KEEP (*crtbegin.o(.dtors))
  79. KEEP (*crtbegin?.o(.dtors))
  80. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  81. KEEP (*(SORT(.dtors.*)))
  82. KEEP (*(.dtors))
  83. } >rom
  84. .lalign :
  85. {
  86. . = ALIGN(4);
  87. } >rom
  88. .dalign :
  89. {
  90. . = ALIGN(4);
  91. } >ram AT>rom
  92. .data :
  93. {
  94. PROVIDE( _data = . );
  95. *(.data .data.*)
  96. *(.gnu.linkonce.d.*)
  97. . = ALIGN(8);
  98. PROVIDE( __global_pointer$ = . + 0x800 );
  99. *(.sdata .sdata.*)
  100. *(.gnu.linkonce.s.*)
  101. } >ram AT>rom
  102. PROVIDE( _data_lma = LOADADDR(.data) );
  103. . = ALIGN(4);
  104. PROVIDE( _edata = . );
  105. PROVIDE( edata = . );
  106. PROVIDE( _fbss = . );
  107. PROVIDE( __bss_start = . );
  108. .bss :
  109. {
  110. *(.sbss*)
  111. *(.gnu.linkonce.sb.*)
  112. *(.bss .bss.*)
  113. *(.gnu.linkonce.b.*)
  114. *(COMMON)
  115. . = ALIGN(4);
  116. } >ram
  117. . = ALIGN(8);
  118. PROVIDE( _end = . );
  119. PROVIDE( end = . );
  120. }
  121. PROVIDE(_sp = ORIGIN(ram) + LENGTH(ram));
  122. PROVIDE(_heap_end = ORIGIN(ram) + LENGTH(ram));