u-boot.lds 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include "config.h"
  7. #ifdef CONFIG_RESET_VECTOR_ADDRESS
  8. #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
  9. #else
  10. #define RESET_VECTOR_ADDRESS 0xfffffffc
  11. #endif
  12. #ifndef CONFIG_SYS_MONITOR_LEN
  13. #define CONFIG_SYS_MONITOR_LEN 0x80000
  14. #endif
  15. OUTPUT_ARCH(powerpc)
  16. ENTRY(_start_e500)
  17. PHDRS
  18. {
  19. text PT_LOAD;
  20. bss PT_LOAD;
  21. }
  22. SECTIONS
  23. {
  24. /* Read-only sections, merged into text segment: */
  25. . = + SIZEOF_HEADERS;
  26. .interp : { *(.interp) }
  27. .text :
  28. {
  29. *(.text*)
  30. } :text
  31. _etext = .;
  32. PROVIDE (etext = .);
  33. .rodata :
  34. {
  35. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  36. } :text
  37. /* Read-write section, merged into data segment: */
  38. . = (. + 0x00FF) & 0xFFFFFF00;
  39. _erotext = .;
  40. PROVIDE (erotext = .);
  41. .reloc :
  42. {
  43. _GOT2_TABLE_ = .;
  44. KEEP(*(.got2))
  45. KEEP(*(.got))
  46. _FIXUP_TABLE_ = .;
  47. KEEP(*(.fixup))
  48. }
  49. __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
  50. __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
  51. .data :
  52. {
  53. *(.data*)
  54. *(.sdata*)
  55. }
  56. _edata = .;
  57. PROVIDE (edata = .);
  58. . = .;
  59. . = ALIGN(4);
  60. .u_boot_list : {
  61. KEEP(*(SORT(.u_boot_list*)));
  62. }
  63. . = .;
  64. __start___ex_table = .;
  65. __ex_table : { *(__ex_table) }
  66. __stop___ex_table = .;
  67. . = ALIGN(256);
  68. __init_begin = .;
  69. .text.init : { *(.text.init) }
  70. .data.init : { *(.data.init) }
  71. . = ALIGN(256);
  72. __init_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. }