vmlinux.lds.S 2.8 KB

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