zero.ld 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2005-2006 by egnite Software GmbH
  3. * Copyright (C) 2011 by egnite GmbH
  4. *
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. Neither the name of the copyright holders nor the names of
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  23. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  24. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  25. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  26. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  27. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  28. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  30. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. * SUCH DAMAGE.
  32. *
  33. * For additional information see http://www.ethernut.de/
  34. */
  35. /*
  36. * $Id$
  37. */
  38. OUTPUT_ARCH(arm)
  39. ENTRY(_start)
  40. STARTUP(crtzero.o)
  41. SEARCH_DIR(.)
  42. MEMORY
  43. {
  44. ram (rw) : org = 0x00000000, len = 256k
  45. rom (rx) : org = 0x10000000, len = 4M
  46. }
  47. SECTIONS
  48. {
  49. .text :
  50. {
  51. *(.vectors);
  52. /* Initialization code. */
  53. . = ALIGN(4); *(.init0);
  54. . = ALIGN(4); *(.init0.user);
  55. . = ALIGN(4); *(.init1);
  56. . = ALIGN(4); *(.init1.user);
  57. . = ALIGN(4); *(.init2);
  58. . = ALIGN(4); *(.init2.user);
  59. . = ALIGN(4); *(.init3);
  60. . = ALIGN(4); *(.init3.user);
  61. . = ALIGN(4); *(.init4);
  62. /* Exit handling. */
  63. . = ALIGN(4); *(.exit0.user);
  64. . = ALIGN(4); *(.exit0);
  65. /* System and application code. */
  66. . = ALIGN(4); *(.text);
  67. . = ALIGN(4); *(.text.*);
  68. /* Constant data. */
  69. . = ALIGN(4); *(.rodata);
  70. . = ALIGN(4); *(.rodata.*);
  71. . = ALIGN(4); *(.eh_frame);
  72. . = ALIGN(4); *(.eh_frame.*);
  73. /* Used for ARM/Thumb interworking. May be better placed in RAM? */
  74. . = ALIGN(4); *(.glue_7t);
  75. . = ALIGN(4); *(.glue_7);
  76. . = ALIGN(4); __data_load_start = .;
  77. } > rom
  78. .lowram :
  79. {
  80. /* Reserve space for RAM copy of vectors. */
  81. . = . + 48;
  82. /* Stacks for exception handlers and low level initialization. */
  83. . = ALIGN(8); *(.stack);
  84. PROVIDE (__stack = .);
  85. } >ram
  86. .data : AT (__data_load_start)
  87. {
  88. . = ALIGN(4);
  89. PROVIDE (__data_start = .);
  90. . = ALIGN(4); *(.data);
  91. . = ALIGN(4); *(.data.*)
  92. . = ALIGN(4); *(.ramfunc);
  93. . = ALIGN(4);
  94. PROVIDE (__data_end = .);
  95. } > ram
  96. .bss :
  97. {
  98. PROVIDE (__bss_start = .);
  99. . = ALIGN(4); *(.bss);
  100. . = ALIGN(4); *(COMMON);
  101. . = ALIGN(4);
  102. PROVIDE (__bss_end = .);
  103. PROVIDE (__heap_start = .);
  104. } > ram
  105. .stab 0 (NOLOAD) :
  106. {
  107. [ .stab ]
  108. }
  109. .stabstr 0 (NOLOAD) :
  110. {
  111. [ .stabstr ]
  112. }
  113. }