u-boot-spl.lds 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * (C) Copyright 2006
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de
  4. *
  5. * Copyright 2009 Freescale Semiconductor, Inc.
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include "config.h"
  10. OUTPUT_ARCH(powerpc)
  11. #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
  12. PHDRS
  13. {
  14. text PT_LOAD;
  15. bss PT_LOAD;
  16. }
  17. #endif
  18. SECTIONS
  19. {
  20. . = CONFIG_SPL_TEXT_BASE;
  21. .text : {
  22. *(.text*)
  23. }
  24. _etext = .;
  25. .reloc : {
  26. _GOT2_TABLE_ = .;
  27. KEEP(*(.got2))
  28. KEEP(*(.got))
  29. PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
  30. _FIXUP_TABLE_ = .;
  31. KEEP(*(.fixup))
  32. }
  33. __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
  34. __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
  35. . = ALIGN(8);
  36. .data : {
  37. *(.rodata*)
  38. *(.data*)
  39. *(.sdata*)
  40. }
  41. _edata = .;
  42. . = ALIGN(4);
  43. .u_boot_list : {
  44. KEEP(*(SORT(.u_boot_list*)));
  45. }
  46. . = .;
  47. __start___ex_table = .;
  48. __ex_table : { *(__ex_table) }
  49. __stop___ex_table = .;
  50. . = ALIGN(8);
  51. __init_begin = .;
  52. __init_end = .;
  53. #ifdef CONFIG_SPL_SKIP_RELOCATE
  54. . = ALIGN(4);
  55. __bss_start = .;
  56. .bss : {
  57. *(.sbss*)
  58. *(.bss*)
  59. }
  60. . = ALIGN(4);
  61. __bss_end = .;
  62. #endif
  63. /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
  64. #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
  65. .bootpg ADDR(.text) - 0x1000 :
  66. {
  67. KEEP(*(.bootpg))
  68. } :text = 0xffff
  69. #else
  70. #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
  71. #ifndef BOOT_PAGE_OFFSET
  72. #define BOOT_PAGE_OFFSET 0x1000
  73. #endif
  74. .bootpg ADDR(.text) + BOOT_PAGE_OFFSET :
  75. {
  76. arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
  77. }
  78. #ifndef RESET_VECTOR_OFFSET
  79. #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
  80. #endif
  81. #elif defined(CONFIG_FSL_ELBC)
  82. #define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
  83. #else
  84. #error unknown NAND controller
  85. #endif
  86. .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
  87. KEEP(*(.resetvec))
  88. } = 0xffff
  89. #endif
  90. #ifndef CONFIG_SPL_SKIP_RELOCATE
  91. /*
  92. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  93. * address won't be updated during relocation fixups.
  94. */
  95. . |= 0x10;
  96. . = ALIGN(4);
  97. __bss_start = .;
  98. .bss : {
  99. *(.sbss*)
  100. *(.bss*)
  101. }
  102. . = ALIGN(4);
  103. __bss_end = .;
  104. #endif
  105. }