u-boot.lds 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Copyright 2007-2009 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include "config.h" /* CONFIG_BOARDDIR */
  7. #ifndef RESET_VECTOR_ADDRESS
  8. #ifdef CONFIG_RESET_VECTOR_ADDRESS
  9. #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
  10. #else
  11. #define RESET_VECTOR_ADDRESS 0xfffffffc
  12. #endif
  13. #endif
  14. OUTPUT_ARCH(powerpc)
  15. PHDRS
  16. {
  17. text PT_LOAD;
  18. bss PT_LOAD;
  19. }
  20. SECTIONS
  21. {
  22. /* Read-only sections, merged into text segment: */
  23. . = + SIZEOF_HEADERS;
  24. .text :
  25. {
  26. *(.text*)
  27. } :text
  28. _etext = .;
  29. PROVIDE (etext = .);
  30. .rodata :
  31. {
  32. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  33. } :text
  34. /* Read-write section, merged into data segment: */
  35. . = (. + 0x00FF) & 0xFFFFFF00;
  36. _erotext = .;
  37. PROVIDE (erotext = .);
  38. .reloc :
  39. {
  40. _GOT2_TABLE_ = .;
  41. KEEP(*(.got2))
  42. KEEP(*(.got))
  43. _FIXUP_TABLE_ = .;
  44. KEEP(*(.fixup))
  45. }
  46. __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
  47. __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
  48. .data :
  49. {
  50. *(.data*)
  51. *(.sdata*)
  52. }
  53. _edata = .;
  54. PROVIDE (edata = .);
  55. . = .;
  56. . = ALIGN(4);
  57. .u_boot_list : {
  58. KEEP(*(SORT(.u_boot_list*)));
  59. }
  60. . = .;
  61. __start___ex_table = .;
  62. __ex_table : { *(__ex_table) }
  63. __stop___ex_table = .;
  64. . = ALIGN(256);
  65. __init_begin = .;
  66. .text.init : { *(.text.init) }
  67. .data.init : {
  68. *(.data.init)
  69. . = ALIGN(256);
  70. LONG(0) LONG(0) /* Extend u-boot.bin to here */
  71. }
  72. __init_end = .;
  73. _end = .;
  74. #ifndef CONFIG_SPL
  75. #ifdef CONFIG_440
  76. .bootpg RESET_VECTOR_ADDRESS - 0xffc :
  77. {
  78. arch/powerpc/cpu/ppc4xx/start.o (.bootpg)
  79. /*
  80. * PPC440 board need a board specific object with the
  81. * TLB definitions. This needs to get included right after
  82. * start.o, since the first shadow TLB only covers 4k
  83. * of address space.
  84. */
  85. #ifdef CONFIG_INIT_TLB
  86. CONFIG_INIT_TLB (.bootpg)
  87. #else
  88. CONFIG_BOARDDIR/init.o (.bootpg)
  89. #endif
  90. } :text = 0xffff
  91. #endif
  92. .resetvec RESET_VECTOR_ADDRESS :
  93. {
  94. KEEP(*(.resetvec))
  95. } :text = 0xffff
  96. . = RESET_VECTOR_ADDRESS + 0x4;
  97. /*
  98. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  99. * address won't be updated during relocation fixups. Note that
  100. * this is a temporary fix. Code to dynamically the fixup the bss
  101. * location will be added in the future. When the bss relocation
  102. * fixup code is present this workaround should be removed.
  103. */
  104. #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
  105. . |= 0x10;
  106. #endif
  107. #endif /* CONFIG_SPL */
  108. __bss_start = .;
  109. .bss (NOLOAD) :
  110. {
  111. *(.bss*)
  112. *(.sbss*)
  113. *(COMMON)
  114. } :bss
  115. . = ALIGN(4);
  116. __bss_end = . ;
  117. PROVIDE (end = .);
  118. }