u-boot-spl.lds 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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" /* CONFIG_BOARDDIR */
  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. /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
  54. #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
  55. .bootpg ADDR(.text) - 0x1000 :
  56. {
  57. KEEP(*(.bootpg))
  58. } :text = 0xffff
  59. #else
  60. #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
  61. #ifndef BOOT_PAGE_OFFSET
  62. #define BOOT_PAGE_OFFSET 0x1000
  63. #endif
  64. .bootpg ADDR(.text) + BOOT_PAGE_OFFSET :
  65. {
  66. arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
  67. }
  68. #ifndef RESET_VECTOR_OFFSET
  69. #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
  70. #endif
  71. #elif defined(CONFIG_FSL_ELBC)
  72. #define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
  73. #else
  74. #error unknown NAND controller
  75. #endif
  76. .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
  77. KEEP(*(.resetvec))
  78. } = 0xffff
  79. #endif
  80. /*
  81. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  82. * address won't be updated during relocation fixups.
  83. */
  84. . |= 0x10;
  85. . = ALIGN(4);
  86. __bss_start = .;
  87. .bss : {
  88. *(.sbss*)
  89. *(.bss*)
  90. }
  91. . = ALIGN(4);
  92. __bss_end = .;
  93. }