gnu-elf.ld 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /****************************************************************************
  2. * configs/samv71-xult/scripts/gnu-elf.ld
  3. *
  4. * Copyright (C) 2015 Gregory Nutt. All rights reserved.
  5. * Author: Gregory Nutt <gnutt@nuttx.org>
  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
  15. * the documentation and/or other materials provided with the
  16. * distribution.
  17. * 3. Neither the name NuttX nor the names of its contributors may be
  18. * used to endorse or promote products derived from this software
  19. * without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. * POSSIBILITY OF SUCH DAMAGE.
  33. *
  34. ****************************************************************************/
  35. SECTIONS
  36. {
  37. .text 0x00000000 :
  38. {
  39. _stext = . ;
  40. *(.text)
  41. *(.text.*)
  42. *(.gnu.warning)
  43. *(.stub)
  44. *(.glue_7)
  45. *(.glue_7t)
  46. *(.jcr)
  47. /* C++ support: The .init and .fini sections contain specific logic
  48. * to manage static constructors and destructors.
  49. */
  50. *(.gnu.linkonce.t.*)
  51. *(.init) /* Old ABI */
  52. *(.fini) /* Old ABI */
  53. _etext = . ;
  54. }
  55. .rodata :
  56. {
  57. _srodata = . ;
  58. *(.rodata)
  59. *(.rodata1)
  60. *(.rodata.*)
  61. *(.gnu.linkonce.r*)
  62. _erodata = . ;
  63. }
  64. .data :
  65. {
  66. _sdata = . ;
  67. *(.data)
  68. *(.data1)
  69. *(.data.*)
  70. *(.gnu.linkonce.d*)
  71. _edata = . ;
  72. }
  73. /* C++ support. For each global and static local C++ object,
  74. * GCC creates a small subroutine to construct the object. Pointers
  75. * to these routines (not the routines themselves) are stored as
  76. * simple, linear arrays in the .ctors section of the object file.
  77. * Similarly, pointers to global/static destructor routines are
  78. * stored in .dtors.
  79. */
  80. .ctors :
  81. {
  82. _sctors = . ;
  83. *(.ctors) /* Old ABI: Unallocated */
  84. *(.init_array) /* New ABI: Allocated */
  85. _edtors = . ;
  86. }
  87. .dtors :
  88. {
  89. _sdtors = . ;
  90. *(.dtors) /* Old ABI: Unallocated */
  91. *(.fini_array) /* New ABI: Allocated */
  92. _edtors = . ;
  93. }
  94. .bss :
  95. {
  96. _sbss = . ;
  97. *(.bss)
  98. *(.bss.*)
  99. *(.sbss)
  100. *(.sbss.*)
  101. *(.gnu.linkonce.b*)
  102. *(COMMON)
  103. _ebss = . ;
  104. }
  105. /* Stabs debugging sections. */
  106. .stab 0 : { *(.stab) }
  107. .stabstr 0 : { *(.stabstr) }
  108. .stab.excl 0 : { *(.stab.excl) }
  109. .stab.exclstr 0 : { *(.stab.exclstr) }
  110. .stab.index 0 : { *(.stab.index) }
  111. .stab.indexstr 0 : { *(.stab.indexstr) }
  112. .comment 0 : { *(.comment) }
  113. .debug_abbrev 0 : { *(.debug_abbrev) }
  114. .debug_info 0 : { *(.debug_info) }
  115. .debug_line 0 : { *(.debug_line) }
  116. .debug_pubnames 0 : { *(.debug_pubnames) }
  117. .debug_aranges 0 : { *(.debug_aranges) }
  118. }