nios2.lds 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
  3. * Scott McNutt <smcnutt@psyent.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. OUTPUT_FORMAT("elf32-littlenios2")
  24. OUTPUT_ARCH(nios2)
  25. ENTRY(_start)
  26. SECTIONS
  27. {
  28. .text :
  29. {
  30. *(.text)
  31. *(.text.*)
  32. *(.gnu.linkonce.t*)
  33. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  34. *(.gnu.linkonce.r*)
  35. }
  36. . = ALIGN (4);
  37. _etext = .;
  38. PROVIDE (etext = .);
  39. /* INIT DATA sections - "Small" data (see the gcc -G option)
  40. * is always gp-relative. Here we make all init data sections
  41. * adjacent to simplify the startup code -- and provide
  42. * the global pointer for gp-relative access.
  43. */
  44. _data = .;
  45. .data :
  46. {
  47. *(.data)
  48. *(.data.*)
  49. *(.gnu.linkonce.d*)
  50. }
  51. . = ALIGN(16);
  52. _gp = .; /* Global pointer addr */
  53. PROVIDE (gp = .);
  54. .sdata :
  55. {
  56. *(.sdata)
  57. *(.sdata.*)
  58. *(.gnu.linkonce.s.*)
  59. }
  60. . = ALIGN(4);
  61. _edata = .;
  62. PROVIDE (edata = .);
  63. /* UNINIT DATA - Small uninitialized data is first so it's
  64. * adjacent to sdata and can be referenced via gp. The normal
  65. * bss follows. We keep it adjacent to simplify init code.
  66. */
  67. __bss_start = .;
  68. .sbss (NOLOAD) :
  69. {
  70. *(.sbss)
  71. *(.sbss.*)
  72. *(.gnu.linkonce.sb.*)
  73. *(.scommon)
  74. }
  75. . = ALIGN(4);
  76. .bss (NOLOAD) :
  77. {
  78. *(.bss)
  79. *(.bss.*)
  80. *(.dynbss)
  81. *(COMMON)
  82. *(.scommon)
  83. }
  84. . = ALIGN(4);
  85. _end = .;
  86. PROVIDE (end = .);
  87. /* CMD TABLE - uboot command sections
  88. */
  89. . = .;
  90. __uboot_cmd_start = .;
  91. .u_boot_cmd :
  92. {
  93. *(.u_boot_cmd)
  94. }
  95. . = ALIGN(4);
  96. __u_boot_cmd_end = .;
  97. /* DEBUG -- symbol table, string table, etc. etc.
  98. */
  99. .stab 0 : { *(.stab) }
  100. .stabstr 0 : { *(.stabstr) }
  101. .stab.excl 0 : { *(.stab.excl) }
  102. .stab.exclstr 0 : { *(.stab.exclstr) }
  103. .stab.index 0 : { *(.stab.index) }
  104. .stab.indexstr 0 : { *(.stab.indexstr) }
  105. .comment 0 : { *(.comment) }
  106. .debug 0 : { *(.debug) }
  107. .line 0 : { *(.line) }
  108. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  109. .debug_sfnames 0 : { *(.debug_sfnames) }
  110. .debug_aranges 0 : { *(.debug_aranges) }
  111. .debug_pubnames 0 : { *(.debug_pubnames) }
  112. .debug_info 0 : { *(.debug_info) }
  113. .debug_abbrev 0 : { *(.debug_abbrev) }
  114. .debug_line 0 : { *(.debug_line) }
  115. .debug_frame 0 : { *(.debug_frame) }
  116. .debug_str 0 : { *(.debug_str) }
  117. .debug_loc 0 : { *(.debug_loc) }
  118. .debug_macinfo 0 : { *(.debug_macinfo) }
  119. .debug_weaknames 0 : { *(.debug_weaknames) }
  120. .debug_funcnames 0 : { *(.debug_funcnames) }
  121. .debug_typenames 0 : { *(.debug_typenames) }
  122. .debug_varnames 0 : { *(.debug_varnames) }
  123. }