u-boot.lds 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. }
  55. .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
  56. {
  57. *(._secure.data)
  58. }
  59. .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
  60. CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
  61. #ifdef __ARMV8_PSCI_STACK_IN_RAM
  62. AT(ADDR(.secure_stack))
  63. #else
  64. AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
  65. #endif
  66. {
  67. KEEP(*(.__secure_stack_start))
  68. . = . + CONFIG_ARMV8_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE;
  69. . = ALIGN(CONSTANT(COMMONPAGESIZE));
  70. KEEP(*(.__secure_stack_end))
  71. }
  72. #ifndef __ARMV8_PSCI_STACK_IN_RAM
  73. . = LOADADDR(.secure_stack);
  74. #endif
  75. .__secure_end : AT(ADDR(.__secure_end)) {
  76. KEEP(*(.__secure_end))
  77. LONG(0x1d1071c); /* Must output something to reset LMA */
  78. }
  79. #endif
  80. . = ALIGN(8);
  81. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  82. . = ALIGN(8);
  83. .data : {
  84. *(.data*)
  85. }
  86. . = ALIGN(8);
  87. . = .;
  88. . = ALIGN(8);
  89. .u_boot_list : {
  90. KEEP(*(SORT(.u_boot_list*)));
  91. }
  92. . = ALIGN(8);
  93. .efi_runtime_rel : {
  94. __efi_runtime_rel_start = .;
  95. *(.rel*.efi_runtime)
  96. *(.rel*.efi_runtime.*)
  97. __efi_runtime_rel_stop = .;
  98. }
  99. . = ALIGN(8);
  100. .image_copy_end :
  101. {
  102. *(.__image_copy_end)
  103. }
  104. . = ALIGN(8);
  105. .rel_dyn_start :
  106. {
  107. *(.__rel_dyn_start)
  108. }
  109. .rela.dyn : {
  110. *(.rela*)
  111. }
  112. .rel_dyn_end :
  113. {
  114. *(.__rel_dyn_end)
  115. }
  116. _end = .;
  117. . = ALIGN(8);
  118. .bss_start : {
  119. KEEP(*(.__bss_start));
  120. }
  121. .bss : {
  122. *(.bss*)
  123. . = ALIGN(8);
  124. }
  125. .bss_end : {
  126. KEEP(*(.__bss_end));
  127. }
  128. /DISCARD/ : { *(.dynsym) }
  129. /DISCARD/ : { *(.dynstr*) }
  130. /DISCARD/ : { *(.dynamic*) }
  131. /DISCARD/ : { *(.plt*) }
  132. /DISCARD/ : { *(.interp*) }
  133. /DISCARD/ : { *(.gnu*) }
  134. #ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
  135. #include "linux-kernel-image-header-vars.h"
  136. #endif
  137. }