u-boot.lds 2.9 KB

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