vmlinux.lds.S 3.3 KB

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