u-boot.lds 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
  3. * Scott McNutt <smcnutt@psyent.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <config.h>
  8. OUTPUT_FORMAT("elf32-littlenios2")
  9. OUTPUT_ARCH(nios2)
  10. ENTRY(_start)
  11. SECTIONS
  12. {
  13. . = CONFIG_SYS_MONITOR_BASE;
  14. .text :
  15. {
  16. arch/nios2/cpu/start.o (.text)
  17. *(.text)
  18. *(.text.*)
  19. *(.gnu.linkonce.t*)
  20. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  21. *(.gnu.linkonce.r*)
  22. }
  23. . = ALIGN (4);
  24. _etext = .;
  25. PROVIDE (etext = .);
  26. /* CMD TABLE - sandwich this in between text and data so
  27. * the initialization code relocates the command table as
  28. * well -- admittedly, this is just pure laziness ;-)
  29. */
  30. . = ALIGN(4);
  31. .u_boot_list : {
  32. KEEP(*(SORT(.u_boot_list*)));
  33. }
  34. /* INIT DATA sections - "Small" data (see the gcc -G option)
  35. * is always gp-relative. Here we make all init data sections
  36. * adjacent to simplify the startup code -- and provide
  37. * the global pointer for gp-relative access.
  38. */
  39. _data = .;
  40. .data :
  41. {
  42. *(.data)
  43. *(.data.*)
  44. *(.gnu.linkonce.d*)
  45. }
  46. /*
  47. * gp - Since we don't use gp for small data with option "-G0",
  48. * we will use gp as global data pointer. The _gp location is
  49. * not needed.
  50. */
  51. .sdata :
  52. {
  53. *(.sdata)
  54. *(.sdata.*)
  55. *(.gnu.linkonce.s.*)
  56. }
  57. . = ALIGN(4);
  58. _edata = .;
  59. PROVIDE (edata = .);
  60. /*
  61. * _end - This is end of u-boot.bin image.
  62. * dtb will be appended here to make u-boot-dtb.bin
  63. */
  64. _end = .;
  65. /* UNINIT DATA - Small uninitialized data is first so it's
  66. * adjacent to sdata and can be referenced via gp. The normal
  67. * bss follows. We keep it adjacent to simplify init code.
  68. */
  69. __bss_start = .;
  70. .sbss (NOLOAD) :
  71. {
  72. *(.sbss)
  73. *(.sbss.*)
  74. *(.gnu.linkonce.sb.*)
  75. *(.scommon)
  76. }
  77. . = ALIGN(4);
  78. .bss (NOLOAD) :
  79. {
  80. *(.bss)
  81. *(.bss.*)
  82. *(.dynbss)
  83. *(COMMON)
  84. *(.scommon)
  85. }
  86. . = ALIGN(4);
  87. __bss_end = .;
  88. PROVIDE (end = .);
  89. /* DEBUG -- symbol table, string table, etc. etc.
  90. */
  91. .stab 0 : { *(.stab) }
  92. .stabstr 0 : { *(.stabstr) }
  93. .stab.excl 0 : { *(.stab.excl) }
  94. .stab.exclstr 0 : { *(.stab.exclstr) }
  95. .stab.index 0 : { *(.stab.index) }
  96. .stab.indexstr 0 : { *(.stab.indexstr) }
  97. .comment 0 : { *(.comment) }
  98. .debug 0 : { *(.debug) }
  99. .line 0 : { *(.line) }
  100. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  101. .debug_sfnames 0 : { *(.debug_sfnames) }
  102. .debug_aranges 0 : { *(.debug_aranges) }
  103. .debug_pubnames 0 : { *(.debug_pubnames) }
  104. .debug_info 0 : { *(.debug_info) }
  105. .debug_abbrev 0 : { *(.debug_abbrev) }
  106. .debug_line 0 : { *(.debug_line) }
  107. .debug_frame 0 : { *(.debug_frame) }
  108. .debug_str 0 : { *(.debug_str) }
  109. .debug_loc 0 : { *(.debug_loc) }
  110. .debug_macinfo 0 : { *(.debug_macinfo) }
  111. .debug_weaknames 0 : { *(.debug_weaknames) }
  112. .debug_funcnames 0 : { *(.debug_funcnames) }
  113. .debug_typenames 0 : { *(.debug_typenames) }
  114. .debug_varnames 0 : { *(.debug_varnames) }
  115. }