u-boot-spl.lds 2.0 KB

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