qtpy.ld 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /**
  2. * \file
  3. *
  4. * \brief Linker script for running in internal FLASH on the SAMD21G18A
  5. *
  6. * Copyright (c) 2017 Microchip Technology Inc.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. * \asf_license_stop
  27. *
  28. */
  29. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  30. OUTPUT_ARCH(arm)
  31. SEARCH_DIR(.)
  32. /* Memory Spaces Definitions */
  33. MEMORY
  34. {
  35. rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K
  36. ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
  37. }
  38. /* The stack size used by the application. NOTE: you need to adjust according to your application. */
  39. STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
  40. ENTRY(Reset_Handler)
  41. /* Section Definitions */
  42. SECTIONS
  43. {
  44. .text :
  45. {
  46. . = ALIGN(4);
  47. _sfixed = .;
  48. KEEP(*(.vectors .vectors.*))
  49. *(.text .text.* .gnu.linkonce.t.*)
  50. *(.glue_7t) *(.glue_7)
  51. *(.rodata .rodata* .gnu.linkonce.r.*)
  52. *(.ARM.extab* .gnu.linkonce.armextab.*)
  53. /* Support C constructors, and C destructors in both user code
  54. and the C library. This also provides support for C++ code. */
  55. . = ALIGN(4);
  56. KEEP(*(.init))
  57. . = ALIGN(4);
  58. __preinit_array_start = .;
  59. KEEP (*(.preinit_array))
  60. __preinit_array_end = .;
  61. . = ALIGN(4);
  62. __init_array_start = .;
  63. KEEP (*(SORT(.init_array.*)))
  64. KEEP (*(.init_array))
  65. __init_array_end = .;
  66. . = ALIGN(4);
  67. KEEP (*crtbegin.o(.ctors))
  68. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  69. KEEP (*(SORT(.ctors.*)))
  70. KEEP (*crtend.o(.ctors))
  71. . = ALIGN(4);
  72. KEEP(*(.fini))
  73. . = ALIGN(4);
  74. __fini_array_start = .;
  75. KEEP (*(.fini_array))
  76. KEEP (*(SORT(.fini_array.*)))
  77. __fini_array_end = .;
  78. KEEP (*crtbegin.o(.dtors))
  79. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  80. KEEP (*(SORT(.dtors.*)))
  81. KEEP (*crtend.o(.dtors))
  82. . = ALIGN(4);
  83. _efixed = .; /* End of text section */
  84. } > rom
  85. /* .ARM.exidx is sorted, so has to go in its own output section. */
  86. PROVIDE_HIDDEN (__exidx_start = .);
  87. .ARM.exidx :
  88. {
  89. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  90. } > rom
  91. PROVIDE_HIDDEN (__exidx_end = .);
  92. . = ALIGN(4);
  93. _etext = .;
  94. .relocate : AT (_etext)
  95. {
  96. . = ALIGN(4);
  97. _srelocate = .;
  98. *(.ramfunc .ramfunc.*);
  99. *(.data .data.*);
  100. . = ALIGN(4);
  101. _erelocate = .;
  102. } > ram
  103. /* .bss section which is used for uninitialized data */
  104. .bss (NOLOAD) :
  105. {
  106. . = ALIGN(4);
  107. _sbss = . ;
  108. _szero = .;
  109. *(.bss .bss.*)
  110. *(COMMON)
  111. . = ALIGN(4);
  112. _ebss = . ;
  113. _ezero = .;
  114. end = .;
  115. } > ram
  116. /* stack section */
  117. .stack (NOLOAD):
  118. {
  119. . = ALIGN(8);
  120. _sstack = .;
  121. . = . + STACK_SIZE;
  122. . = ALIGN(8);
  123. _estack = .;
  124. } > ram
  125. . = ALIGN(4);
  126. _end = . ;
  127. }