sections_boot.ld 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Copyright 2012 by Embedded Technologies s.r.o
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. SECTIONS
  33. {
  34. .text :
  35. {
  36. LONG(__stack_init)/* Initial SP */
  37. LONG(_start) /* Initial PC */
  38. LONG(0) /* Placeholder for custom data */
  39. LONG(0) /* Placeholder for custom data */
  40. KEEP(*(.init0)) /* Basic CPU initialization (family dependant code). */
  41. KEEP(*(.init1))
  42. KEEP(*(.init2)) /* Set up stack pointer. */
  43. KEEP(*(.init3))
  44. KEEP(*(.init4)) /* External Memories initialization (board dependant code). */
  45. KEEP(*(.init5))
  46. KEEP(*(.init6)) /* Initialize memory regions */
  47. KEEP(*(.init7))
  48. KEEP(*(.init8)) /* Relocate vectors, Enable interrupts */
  49. KEEP(*(.init9))
  50. KEEP(*(.init10)) /* CPU and Peripherals Initialization (family dependant code). */
  51. KEEP(*(.init11))
  52. KEEP(*(.init12)) /* C++ constructors (NOT implemented yet). */
  53. KEEP(*(.init13))
  54. KEEP(*(.init14)) /* Enter Nut/OS Initialization. */
  55. *(.text)
  56. *(.text.*)
  57. *(.gnu.linkonce.t.* .gcc_except_table .gcc_except_table.*)
  58. /* following table is used in InitRegions() */
  59. . = ALIGN(4);
  60. PROVIDE (__regions_start = .) ;
  61. LONG (__dataint_start)
  62. LONG (__dataint_size)
  63. LONG (__dataint_load_start)
  64. LONG (__data_start)
  65. LONG (__data_size)
  66. LONG (__data_load_start)
  67. LONG (__bssint_start)
  68. LONG (__bssint_size)
  69. LONG (__bssint_start) /* No init data */
  70. LONG (__bss_start)
  71. LONG (__bss_size)
  72. LONG (__bss_start) /* No init data */
  73. PROVIDE (__regions_end = .);
  74. } > REGION_TEXT AT > REGION_LOAD
  75. .rodata : ALIGN (4)
  76. {
  77. *(.rodata)
  78. *(.rodata.*)
  79. *(.gnu.linkonce.r.*)
  80. } > REGION_RODATA AT > REGION_LOAD
  81. .dataint : ALIGN(4)
  82. {
  83. PROVIDE (__dataint_start = .) ;
  84. PROVIDE (__vectors_start = .) ;
  85. KEEP(*(.vectors))
  86. *(.dataint)
  87. *(.dataint.*)
  88. . = ALIGN(4);
  89. PROVIDE (__dataint_end = .) ;
  90. } > REGION_DATA_INT AT > REGION_LOAD
  91. PROVIDE (__dataint_size = SIZEOF(.dataint));
  92. PROVIDE (__dataint_load_start = LOADADDR(.dataint));
  93. .bssint : ALIGN (4)
  94. {
  95. PROVIDE (__bssint_start = .) ;
  96. *(.bssint)
  97. *(.bssint.*)
  98. PROVIDE (__bssint_end = .) ;
  99. } > REGION_BSS_INT AT > REGION_LOAD
  100. PROVIDE (__bssint_size = SIZEOF(.bssint));
  101. .data : ALIGN(4)
  102. {
  103. PROVIDE (__data_start = .) ;
  104. *(.data)
  105. *(.data.*)
  106. *(.gnu.linkonce.d.*)
  107. . = ALIGN(4);
  108. PROVIDE (__data_end = .) ;
  109. } > REGION_DATA AT > REGION_LOAD
  110. PROVIDE (__data_size = SIZEOF(.data));
  111. PROVIDE (__data_load_start = LOADADDR(.data));
  112. .bss : ALIGN (4)
  113. {
  114. PROVIDE (__bss_start = .) ;
  115. *(.bss)
  116. *(.bss.*)
  117. *(.gnu.linkonce.b.*)
  118. *(COMMON)
  119. PROVIDE (__bss_end = .) ;
  120. } > REGION_BSS AT > REGION_LOAD
  121. PROVIDE (__bss_size = SIZEOF(.bss));
  122. }