u-boot.lds 2.8 KB

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