vmlinux.lds.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. #include <asm-generic/vmlinux.lds.h>
  7. #ifndef CONFIG_64BIT
  8. OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
  9. OUTPUT_ARCH(s390)
  10. ENTRY(_start)
  11. jiffies = jiffies_64 + 4;
  12. #else
  13. OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
  14. OUTPUT_ARCH(s390:64-bit)
  15. ENTRY(_start)
  16. jiffies = jiffies_64;
  17. #endif
  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 = .; /* Text and read-only data */
  28. HEAD_TEXT
  29. TEXT_TEXT
  30. SCHED_TEXT
  31. LOCK_TEXT
  32. KPROBES_TEXT
  33. IRQENTRY_TEXT
  34. *(.fixup)
  35. *(.gnu.warning)
  36. } :text = 0x0700
  37. _etext = .; /* End of text section */
  38. NOTES :text :note
  39. RODATA
  40. #ifdef CONFIG_SHARED_KERNEL
  41. . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
  42. #endif
  43. . = ALIGN(PAGE_SIZE);
  44. _eshared = .; /* End of shareable data */
  45. . = ALIGN(16); /* Exception table */
  46. __ex_table : {
  47. __start___ex_table = .;
  48. *(__ex_table)
  49. __stop___ex_table = .;
  50. } :data
  51. .data : { /* Data */
  52. DATA_DATA
  53. CONSTRUCTORS
  54. }
  55. . = ALIGN(PAGE_SIZE);
  56. .data_nosave : {
  57. __nosave_begin = .;
  58. *(.data.nosave)
  59. }
  60. . = ALIGN(PAGE_SIZE);
  61. __nosave_end = .;
  62. . = ALIGN(PAGE_SIZE);
  63. .data.page_aligned : {
  64. *(.data.idt)
  65. }
  66. . = ALIGN(0x100);
  67. .data.cacheline_aligned : {
  68. *(.data.cacheline_aligned)
  69. }
  70. . = ALIGN(0x100);
  71. .data.read_mostly : {
  72. *(.data.read_mostly)
  73. }
  74. _edata = .; /* End of data section */
  75. . = ALIGN(THREAD_SIZE); /* init_task */
  76. .data.init_task : {
  77. *(.data.init_task)
  78. }
  79. /* will be freed after init */
  80. . = ALIGN(PAGE_SIZE); /* Init code and data */
  81. __init_begin = .;
  82. .init.text : {
  83. _sinittext = .;
  84. INIT_TEXT
  85. _einittext = .;
  86. }
  87. /*
  88. * .exit.text is discarded at runtime, not link time,
  89. * to deal with references from __bug_table
  90. */
  91. .exit.text : {
  92. EXIT_TEXT
  93. }
  94. /* early.c uses stsi, which requires page aligned data. */
  95. . = ALIGN(PAGE_SIZE);
  96. .init.data : {
  97. INIT_DATA
  98. }
  99. . = ALIGN(0x100);
  100. .init.setup : {
  101. __setup_start = .;
  102. *(.init.setup)
  103. __setup_end = .;
  104. }
  105. .initcall.init : {
  106. __initcall_start = .;
  107. INITCALLS
  108. __initcall_end = .;
  109. }
  110. .con_initcall.init : {
  111. __con_initcall_start = .;
  112. *(.con_initcall.init)
  113. __con_initcall_end = .;
  114. }
  115. SECURITY_INIT
  116. #ifdef CONFIG_BLK_DEV_INITRD
  117. . = ALIGN(0x100);
  118. .init.ramfs : {
  119. __initramfs_start = .;
  120. *(.init.ramfs)
  121. . = ALIGN(2);
  122. __initramfs_end = .;
  123. }
  124. #endif
  125. PERCPU(PAGE_SIZE)
  126. . = ALIGN(PAGE_SIZE);
  127. __init_end = .; /* freed after init ends here */
  128. /* BSS */
  129. .bss : {
  130. __bss_start = .;
  131. *(.bss)
  132. . = ALIGN(2);
  133. __bss_stop = .;
  134. }
  135. _end = . ;
  136. /* Sections to be discarded */
  137. /DISCARD/ : {
  138. EXIT_DATA
  139. *(.exitcall.exit)
  140. }
  141. /* Debugging sections. */
  142. STABS_DEBUG
  143. DWARF_DEBUG
  144. }