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.

137 lines
3.1 KiB

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