vmlinux.lds.S 2.7 KB

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