u-boot-spl.lds 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. _FIXUP_TABLE_ = .;
  30. KEEP(*(.fixup))
  31. }
  32. __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
  33. __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
  34. . = ALIGN(8);
  35. .data : {
  36. *(.rodata*)
  37. *(.data*)
  38. *(.sdata*)
  39. }
  40. _edata = .;
  41. . = ALIGN(4);
  42. .u_boot_list : {
  43. KEEP(*(SORT(.u_boot_list*)));
  44. }
  45. . = .;
  46. __start___ex_table = .;
  47. __ex_table : { *(__ex_table) }
  48. __stop___ex_table = .;
  49. . = ALIGN(8);
  50. __init_begin = .;
  51. __init_end = .;
  52. #ifdef CONFIG_SPL_SKIP_RELOCATE
  53. . = ALIGN(4);
  54. __bss_start = .;
  55. .bss : {
  56. *(.sbss*)
  57. *(.bss*)
  58. }
  59. . = ALIGN(4);
  60. __bss_end = .;
  61. #endif
  62. /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
  63. #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
  64. .bootpg ADDR(.text) - 0x1000 :
  65. {
  66. KEEP(*(.bootpg))
  67. } :text = 0xffff
  68. #else
  69. #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
  70. #ifndef BOOT_PAGE_OFFSET
  71. #define BOOT_PAGE_OFFSET 0x1000
  72. #endif
  73. .bootpg ADDR(.text) + BOOT_PAGE_OFFSET :
  74. {
  75. arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
  76. }
  77. #ifndef RESET_VECTOR_OFFSET
  78. #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
  79. #endif
  80. #elif defined(CONFIG_FSL_ELBC)
  81. #define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
  82. #else
  83. #error unknown NAND controller
  84. #endif
  85. .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
  86. KEEP(*(.resetvec))
  87. } = 0xffff
  88. #endif
  89. #ifndef CONFIG_SPL_SKIP_RELOCATE
  90. /*
  91. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  92. * address won't be updated during relocation fixups.
  93. */
  94. . |= 0x10;
  95. . = ALIGN(4);
  96. __bss_start = .;
  97. .bss : {
  98. *(.sbss*)
  99. *(.bss*)
  100. }
  101. . = ALIGN(4);
  102. __bss_end = .;
  103. #endif
  104. }