u-boot.lds 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. *(.text*)
  26. }
  27. #ifdef CONFIG_ARMV8_PSCI
  28. .__secure_start :
  29. #ifndef CONFIG_ARMV8_SECURE_BASE
  30. ALIGN(CONSTANT(COMMONPAGESIZE))
  31. #endif
  32. {
  33. KEEP(*(.__secure_start))
  34. }
  35. #ifndef CONFIG_ARMV8_SECURE_BASE
  36. #define CONFIG_ARMV8_SECURE_BASE
  37. #define __ARMV8_PSCI_STACK_IN_RAM
  38. #endif
  39. .secure_text CONFIG_ARMV8_SECURE_BASE :
  40. AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
  41. {
  42. *(._secure.text)
  43. }
  44. .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
  45. {
  46. *(._secure.data)
  47. }
  48. .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
  49. CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
  50. #ifdef __ARMV8_PSCI_STACK_IN_RAM
  51. AT(ADDR(.secure_stack))
  52. #else
  53. AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
  54. #endif
  55. {
  56. KEEP(*(.__secure_stack_start))
  57. . = . + CONFIG_ARMV8_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE;
  58. . = ALIGN(CONSTANT(COMMONPAGESIZE));
  59. KEEP(*(.__secure_stack_end))
  60. }
  61. #ifndef __ARMV8_PSCI_STACK_IN_RAM
  62. . = LOADADDR(.secure_stack);
  63. #endif
  64. .__secure_end : AT(ADDR(.__secure_end)) {
  65. KEEP(*(.__secure_end))
  66. LONG(0x1d1071c); /* Must output something to reset LMA */
  67. }
  68. #endif
  69. . = ALIGN(8);
  70. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  71. . = ALIGN(8);
  72. .data : {
  73. *(.data*)
  74. }
  75. . = ALIGN(8);
  76. . = .;
  77. . = ALIGN(8);
  78. .u_boot_list : {
  79. KEEP(*(SORT(.u_boot_list*)));
  80. }
  81. . = ALIGN(8);
  82. .efi_runtime : {
  83. __efi_runtime_start = .;
  84. *(efi_runtime_text)
  85. *(efi_runtime_data)
  86. __efi_runtime_stop = .;
  87. }
  88. .efi_runtime_rel : {
  89. __efi_runtime_rel_start = .;
  90. *(.relaefi_runtime_text)
  91. *(.relaefi_runtime_data)
  92. __efi_runtime_rel_stop = .;
  93. }
  94. . = ALIGN(8);
  95. .image_copy_end :
  96. {
  97. *(.__image_copy_end)
  98. }
  99. . = ALIGN(8);
  100. .rel_dyn_start :
  101. {
  102. *(.__rel_dyn_start)
  103. }
  104. .rela.dyn : {
  105. *(.rela*)
  106. }
  107. .rel_dyn_end :
  108. {
  109. *(.__rel_dyn_end)
  110. }
  111. _end = .;
  112. . = ALIGN(8);
  113. .bss_start : {
  114. KEEP(*(.__bss_start));
  115. }
  116. .bss : {
  117. *(.bss*)
  118. . = ALIGN(8);
  119. }
  120. .bss_end : {
  121. KEEP(*(.__bss_end));
  122. }
  123. /DISCARD/ : { *(.dynsym) }
  124. /DISCARD/ : { *(.dynstr*) }
  125. /DISCARD/ : { *(.dynamic*) }
  126. /DISCARD/ : { *(.plt*) }
  127. /DISCARD/ : { *(.interp*) }
  128. /DISCARD/ : { *(.gnu*) }
  129. #ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
  130. #include "linux-kernel-image-header-vars.h"
  131. #endif
  132. }