u-boot.lds 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * (C) Copyright 2003
  3. * Wolfgang Denk Engineering, <wd@denx.de>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #if defined(CONFIG_64BIT)
  8. #define PTR_COUNT_SHIFT 3
  9. #else
  10. #define PTR_COUNT_SHIFT 2
  11. #endif
  12. OUTPUT_ARCH(mips)
  13. ENTRY(_start)
  14. SECTIONS
  15. {
  16. . = 0x00000000;
  17. . = ALIGN(4);
  18. .text : {
  19. __text_start = .;
  20. *(.text*)
  21. __text_end = .;
  22. }
  23. . = ALIGN(4);
  24. .rodata : {
  25. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  26. }
  27. . = ALIGN(4);
  28. .data : {
  29. *(.data*)
  30. }
  31. . = .;
  32. _gp = ALIGN(16) + 0x7ff0;
  33. .got : {
  34. *(.got)
  35. }
  36. num_got_entries = SIZEOF(.got) >> PTR_COUNT_SHIFT;
  37. . = ALIGN(4);
  38. .sdata : {
  39. *(.sdata*)
  40. }
  41. . = ALIGN(4);
  42. .u_boot_list : {
  43. KEEP(*(SORT(.u_boot_list*)));
  44. }
  45. . = ALIGN(4);
  46. __image_copy_end = .;
  47. __init_end = .;
  48. .rel.dyn : {
  49. __rel_dyn_start = .;
  50. *(.rel.dyn)
  51. __rel_dyn_end = .;
  52. }
  53. .padding : {
  54. /*
  55. * Workaround for a binutils feature (or bug?).
  56. *
  57. * The GNU ld from binutils puts the dynamic relocation
  58. * entries into the .rel.dyn section. Sometimes it
  59. * allocates more dynamic relocation entries than it needs
  60. * and the unused slots are set to R_MIPS_NONE entries.
  61. *
  62. * However the size of the .rel.dyn section in the ELF
  63. * section header does not cover the unused entries, so
  64. * objcopy removes those during stripping.
  65. *
  66. * Create a small section here to avoid that.
  67. */
  68. LONG(0xFFFFFFFF)
  69. }
  70. _end = .;
  71. .bss __rel_dyn_start (OVERLAY) : {
  72. __bss_start = .;
  73. *(.sbss.*)
  74. *(.bss.*)
  75. *(COMMON)
  76. . = ALIGN(4);
  77. __bss_end = .;
  78. }
  79. .dynsym _end : {
  80. *(.dynsym)
  81. }
  82. .dynbss : {
  83. *(.dynbss)
  84. }
  85. .dynstr : {
  86. *(.dynstr)
  87. }
  88. .dynamic : {
  89. *(.dynamic)
  90. }
  91. .plt : {
  92. *(.plt)
  93. }
  94. .interp : {
  95. *(.interp)
  96. }
  97. .gnu : {
  98. *(.gnu*)
  99. }
  100. .MIPS.stubs : {
  101. *(.MIPS.stubs)
  102. }
  103. .hash : {
  104. *(.hash)
  105. }
  106. }