u-boot.lds 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
  73. .bootpg ADDR(.text) - 0x1000 :
  74. {
  75. KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg))
  76. } :text = 0xffff
  77. . = ADDR(.text) + CONFIG_SYS_MONITOR_LEN;
  78. #else
  79. .bootpg RESET_VECTOR_ADDRESS - 0xffc :
  80. {
  81. arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
  82. } :text = 0xffff
  83. .resetvec RESET_VECTOR_ADDRESS :
  84. {
  85. KEEP(*(.resetvec))
  86. } :text = 0xffff
  87. . = RESET_VECTOR_ADDRESS + 0x4;
  88. /*
  89. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  90. * address won't be updated during relocation fixups. Note that
  91. * this is a temporary fix. Code to dynamically the fixup the bss
  92. * location will be added in the future. When the bss relocation
  93. * fixup code is present this workaround should be removed.
  94. */
  95. #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
  96. . |= 0x10;
  97. #endif
  98. #endif
  99. __bss_start = .;
  100. .bss (NOLOAD) :
  101. {
  102. *(.sbss*)
  103. *(.bss*)
  104. *(COMMON)
  105. } :bss
  106. . = ALIGN(4);
  107. __bss_end = . ;
  108. PROVIDE (end = .);
  109. }