u-boot.lds 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * (C) Copyright 2013
  3. * David Feng <fenghua@phytium.com.cn>
  4. *
  5. * (C) Copyright 2002
  6. * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #include <config.h>
  11. #include <asm/psci.h>
  12. OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
  13. OUTPUT_ARCH(aarch64)
  14. ENTRY(_start)
  15. SECTIONS
  16. {
  17. #ifdef CONFIG_ARMV8_SECURE_BASE
  18. /DISCARD/ : { *(.rela._secure*) }
  19. #endif
  20. . = 0x00000000;
  21. . = ALIGN(8);
  22. .text :
  23. {
  24. *(.__image_copy_start)
  25. CPUDIR/start.o (.text*)
  26. *(.text*)
  27. }
  28. #ifdef CONFIG_ARMV8_PSCI
  29. .__secure_start :
  30. #ifndef CONFIG_ARMV8_SECURE_BASE
  31. ALIGN(CONSTANT(COMMONPAGESIZE))
  32. #endif
  33. {
  34. KEEP(*(.__secure_start))
  35. }
  36. #ifndef CONFIG_ARMV8_SECURE_BASE
  37. #define CONFIG_ARMV8_SECURE_BASE
  38. #define __ARMV8_PSCI_STACK_IN_RAM
  39. #endif
  40. .secure_text CONFIG_ARMV8_SECURE_BASE :
  41. AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
  42. {
  43. *(._secure.text)
  44. }
  45. .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
  46. {
  47. *(._secure.data)
  48. }
  49. .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
  50. CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
  51. #ifdef __ARMV8_PSCI_STACK_IN_RAM
  52. AT(ADDR(.secure_stack))
  53. #else
  54. AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
  55. #endif
  56. {
  57. KEEP(*(.__secure_stack_start))
  58. . = . + CONFIG_ARMV8_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE;
  59. . = ALIGN(CONSTANT(COMMONPAGESIZE));
  60. KEEP(*(.__secure_stack_end))
  61. }
  62. #ifndef __ARMV8_PSCI_STACK_IN_RAM
  63. . = LOADADDR(.secure_stack);
  64. #endif
  65. .__secure_end : AT(ADDR(.__secure_end)) {
  66. KEEP(*(.__secure_end))
  67. LONG(0x1d1071c); /* Must output something to reset LMA */
  68. }
  69. #endif
  70. . = ALIGN(8);
  71. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  72. . = ALIGN(8);
  73. .data : {
  74. *(.data*)
  75. }
  76. . = ALIGN(8);
  77. . = .;
  78. . = ALIGN(8);
  79. .u_boot_list : {
  80. KEEP(*(SORT(.u_boot_list*)));
  81. }
  82. . = ALIGN(8);
  83. .efi_runtime : {
  84. __efi_runtime_start = .;
  85. *(efi_runtime_text)
  86. *(efi_runtime_data)
  87. __efi_runtime_stop = .;
  88. }
  89. .efi_runtime_rel : {
  90. __efi_runtime_rel_start = .;
  91. *(.relaefi_runtime_text)
  92. *(.relaefi_runtime_data)
  93. __efi_runtime_rel_stop = .;
  94. }
  95. . = ALIGN(8);
  96. .image_copy_end :
  97. {
  98. *(.__image_copy_end)
  99. }
  100. . = ALIGN(8);
  101. .rel_dyn_start :
  102. {
  103. *(.__rel_dyn_start)
  104. }
  105. .rela.dyn : {
  106. *(.rela*)
  107. }
  108. .rel_dyn_end :
  109. {
  110. *(.__rel_dyn_end)
  111. }
  112. _end = .;
  113. . = ALIGN(8);
  114. .bss_start : {
  115. KEEP(*(.__bss_start));
  116. }
  117. .bss : {
  118. *(.bss*)
  119. . = ALIGN(8);
  120. }
  121. .bss_end : {
  122. KEEP(*(.__bss_end));
  123. }
  124. /DISCARD/ : { *(.dynsym) }
  125. /DISCARD/ : { *(.dynstr*) }
  126. /DISCARD/ : { *(.dynamic*) }
  127. /DISCARD/ : { *(.plt*) }
  128. /DISCARD/ : { *(.interp*) }
  129. /DISCARD/ : { *(.gnu*) }
  130. }