u-boot.lds 2.4 KB

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