vmlinux.lds.S 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* ld script to make s390 Linux kernel
  3. * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
  4. */
  5. #include <asm/thread_info.h>
  6. #include <asm/page.h>
  7. /*
  8. * Put .bss..swapper_pg_dir as the first thing in .bss. This will
  9. * make sure it has 16k alignment.
  10. */
  11. #define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
  12. /* Handle ro_after_init data on our own. */
  13. #define RO_AFTER_INIT_DATA
  14. #include <asm-generic/vmlinux.lds.h>
  15. OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
  16. OUTPUT_ARCH(s390:64-bit)
  17. ENTRY(startup_continue)
  18. jiffies = jiffies_64;
  19. PHDRS {
  20. text PT_LOAD FLAGS(5); /* R_E */
  21. data PT_LOAD FLAGS(7); /* RWE */
  22. note PT_NOTE FLAGS(0); /* ___ */
  23. }
  24. SECTIONS
  25. {
  26. . = 0x100000;
  27. .text : {
  28. _stext = .; /* Start of text section */
  29. _text = .; /* Text and read-only data */
  30. HEAD_TEXT
  31. TEXT_TEXT
  32. SCHED_TEXT
  33. CPUIDLE_TEXT
  34. LOCK_TEXT
  35. KPROBES_TEXT
  36. IRQENTRY_TEXT
  37. SOFTIRQENTRY_TEXT
  38. *(.text.*_indirect_*)
  39. *(.fixup)
  40. *(.gnu.warning)
  41. . = ALIGN(PAGE_SIZE);
  42. _etext = .; /* End of text section */
  43. } :text = 0x0700
  44. NOTES :text :note
  45. .dummy : { *(.dummy) } :data
  46. RO_DATA_SECTION(PAGE_SIZE)
  47. . = ALIGN(PAGE_SIZE);
  48. _sdata = .; /* Start of data section */
  49. . = ALIGN(PAGE_SIZE);
  50. __start_ro_after_init = .;
  51. .data..ro_after_init : {
  52. *(.data..ro_after_init)
  53. }
  54. EXCEPTION_TABLE(16)
  55. . = ALIGN(PAGE_SIZE);
  56. __end_ro_after_init = .;
  57. RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
  58. _edata = .; /* End of data section */
  59. /* will be freed after init */
  60. . = ALIGN(PAGE_SIZE); /* Init code and data */
  61. __init_begin = .;
  62. . = ALIGN(PAGE_SIZE);
  63. .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
  64. _sinittext = .;
  65. INIT_TEXT
  66. . = ALIGN(PAGE_SIZE);
  67. _einittext = .;
  68. }
  69. /*
  70. * .exit.text is discarded at runtime, not link time,
  71. * to deal with references from __bug_table
  72. */
  73. .exit.text : {
  74. EXIT_TEXT
  75. }
  76. .exit.data : {
  77. EXIT_DATA
  78. }
  79. /*
  80. * struct alt_inst entries. From the header (alternative.h):
  81. * "Alternative instructions for different CPU types or capabilities"
  82. * Think locking instructions on spinlocks.
  83. * Note, that it is a part of __init region.
  84. */
  85. . = ALIGN(8);
  86. .altinstructions : {
  87. __alt_instructions = .;
  88. *(.altinstructions)
  89. __alt_instructions_end = .;
  90. }
  91. /*
  92. * And here are the replacement instructions. The linker sticks
  93. * them as binary blobs. The .altinstructions has enough data to
  94. * get the address and the length of them to patch the kernel safely.
  95. * Note, that it is a part of __init region.
  96. */
  97. .altinstr_replacement : {
  98. *(.altinstr_replacement)
  99. }
  100. /*
  101. * Table with the patch locations to undo expolines
  102. */
  103. .nospec_call_table : {
  104. __nospec_call_start = . ;
  105. *(.s390_indirect*)
  106. __nospec_call_end = . ;
  107. }
  108. .nospec_return_table : {
  109. __nospec_return_start = . ;
  110. *(.s390_return*)
  111. __nospec_return_end = . ;
  112. }
  113. /* early.c uses stsi, which requires page aligned data. */
  114. . = ALIGN(PAGE_SIZE);
  115. INIT_DATA_SECTION(0x100)
  116. PERCPU_SECTION(0x100)
  117. . = ALIGN(PAGE_SIZE);
  118. __init_end = .; /* freed after init ends here */
  119. BSS_SECTION(PAGE_SIZE, 4 * PAGE_SIZE, PAGE_SIZE)
  120. _end = . ;
  121. /* Debugging sections. */
  122. STABS_DEBUG
  123. DWARF_DEBUG
  124. /* Sections to be discarded */
  125. DISCARDS
  126. /DISCARD/ : {
  127. *(.eh_frame)
  128. }
  129. }