vmlinux.lds.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <asm-generic/vmlinux.lds.h>
  3. #include <asm/vmlinux.lds.h>
  4. #include <asm/thread_info.h>
  5. #include <asm/page.h>
  6. #include <asm/sclp.h>
  7. #include "boot.h"
  8. OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
  9. OUTPUT_ARCH(s390:64-bit)
  10. ENTRY(startup)
  11. SECTIONS
  12. {
  13. . = 0;
  14. .ipldata : {
  15. *(.ipldata)
  16. }
  17. . = IPL_START;
  18. .head.text : {
  19. _head = . ;
  20. HEAD_TEXT
  21. _ehead = . ;
  22. }
  23. . = PARMAREA;
  24. .parmarea : {
  25. *(.parmarea)
  26. }
  27. .text : {
  28. _text = .; /* Text */
  29. *(.text)
  30. *(.text.*)
  31. INIT_TEXT
  32. _etext = . ;
  33. }
  34. .rodata : {
  35. _rodata = . ;
  36. *(.rodata) /* read-only data */
  37. *(.rodata.*)
  38. _erodata = . ;
  39. }
  40. EXCEPTION_TABLE(16)
  41. .got : {
  42. *(.got)
  43. }
  44. NOTES
  45. .data : {
  46. _data = . ;
  47. *(.data)
  48. *(.data.*)
  49. _edata = . ;
  50. }
  51. BOOT_DATA
  52. BOOT_DATA_PRESERVED
  53. /*
  54. * This is the BSS section of the decompressor and not of the decompressed Linux kernel.
  55. * It will consume place in the decompressor's image.
  56. */
  57. . = ALIGN(8);
  58. .bss : {
  59. _bss = . ;
  60. *(.bss)
  61. *(.bss.*)
  62. *(COMMON)
  63. /*
  64. * Stacks for the decompressor
  65. */
  66. . = ALIGN(PAGE_SIZE);
  67. _dump_info_stack_start = .;
  68. . += PAGE_SIZE;
  69. _dump_info_stack_end = .;
  70. . = ALIGN(PAGE_SIZE);
  71. _stack_start = .;
  72. . += BOOT_STACK_SIZE;
  73. _stack_end = .;
  74. _ebss = .;
  75. }
  76. /*
  77. * uncompressed image info used by the decompressor it should match
  78. * struct vmlinux_info. It comes from .vmlinux.info section of
  79. * uncompressed vmlinux in a form of info.o
  80. */
  81. . = ALIGN(8);
  82. .vmlinux.info : {
  83. _vmlinux_info = .;
  84. *(.vmlinux.info)
  85. }
  86. .decompressor.syms : {
  87. . += 1; /* make sure we have \0 before the first entry */
  88. . = ALIGN(2);
  89. _decompressor_syms_start = .;
  90. *(.decompressor.syms)
  91. _decompressor_syms_end = .;
  92. }
  93. _decompressor_end = .;
  94. . = ALIGN(4);
  95. .vmlinux.relocs : {
  96. __vmlinux_relocs_64_start = .;
  97. *(.vmlinux.relocs_64)
  98. __vmlinux_relocs_64_end = .;
  99. }
  100. #ifdef CONFIG_KERNEL_UNCOMPRESSED
  101. . = ALIGN(PAGE_SIZE);
  102. . += AMODE31_SIZE; /* .amode31 section */
  103. /*
  104. * Make sure the location counter is not less than TEXT_OFFSET.
  105. * _SEGMENT_SIZE is not available, use ALIGN(1 << 20) instead.
  106. */
  107. . = MAX(TEXT_OFFSET, ALIGN(1 << 20));
  108. #else
  109. . = ALIGN(8);
  110. #endif
  111. .rodata.compressed : {
  112. _compressed_start = .;
  113. *(.vmlinux.bin.compressed)
  114. _compressed_end = .;
  115. }
  116. #define SB_TRAILER_SIZE 32
  117. /* Trailer needed for Secure Boot */
  118. . += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
  119. . = ALIGN(4096) - SB_TRAILER_SIZE;
  120. .sb.trailer : {
  121. QUAD(0)
  122. QUAD(0)
  123. QUAD(0)
  124. QUAD(0x000000207a49504c)
  125. }
  126. _end = .;
  127. /* Sections to be discarded */
  128. /DISCARD/ : {
  129. COMMON_DISCARDS
  130. *(.eh_frame)
  131. *(*__ksymtab*)
  132. *(___kcrctab*)
  133. *(.modinfo)
  134. }
  135. DWARF_DEBUG
  136. ELF_DETAILS
  137. /*
  138. * Make sure that the .got.plt is either completely empty or it
  139. * contains only the three reserved double words.
  140. */
  141. .got.plt : {
  142. *(.got.plt)
  143. }
  144. ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
  145. /*
  146. * Sections that should stay zero sized, which is safer to
  147. * explicitly check instead of blindly discarding.
  148. */
  149. .plt : {
  150. *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
  151. }
  152. ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
  153. .rela.dyn : {
  154. *(.rela.*) *(.rela_*)
  155. }
  156. ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
  157. }