vmlinux.lds.S 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. . = ALIGN(PAGE_SIZE);
  46. _etext = .; /* End of text section */
  47. NOTES :text :note
  48. .dummy : { *(.dummy) } :data
  49. RO_DATA_SECTION(PAGE_SIZE)
  50. #ifdef CONFIG_SHARED_KERNEL
  51. . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
  52. #endif
  53. . = ALIGN(PAGE_SIZE);
  54. _eshared = .; /* End of shareable data */
  55. _sdata = .; /* Start of data section */
  56. . = ALIGN(PAGE_SIZE);
  57. __start_ro_after_init = .;
  58. .data..ro_after_init : {
  59. *(.data..ro_after_init)
  60. }
  61. EXCEPTION_TABLE(16)
  62. . = ALIGN(PAGE_SIZE);
  63. __end_ro_after_init = .;
  64. RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
  65. _edata = .; /* End of data section */
  66. /* will be freed after init */
  67. . = ALIGN(PAGE_SIZE); /* Init code and data */
  68. __init_begin = .;
  69. . = ALIGN(PAGE_SIZE);
  70. .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
  71. VMLINUX_SYMBOL(_sinittext) = . ;
  72. INIT_TEXT
  73. . = ALIGN(PAGE_SIZE);
  74. VMLINUX_SYMBOL(_einittext) = . ;
  75. }
  76. /*
  77. * .exit.text is discarded at runtime, not link time,
  78. * to deal with references from __bug_table
  79. */
  80. .exit.text : {
  81. EXIT_TEXT
  82. }
  83. .exit.data : {
  84. EXIT_DATA
  85. }
  86. /* early.c uses stsi, which requires page aligned data. */
  87. . = ALIGN(PAGE_SIZE);
  88. INIT_DATA_SECTION(0x100)
  89. PERCPU_SECTION(0x100)
  90. . = ALIGN(PAGE_SIZE);
  91. __init_end = .; /* freed after init ends here */
  92. BSS_SECTION(PAGE_SIZE, 4 * PAGE_SIZE, PAGE_SIZE)
  93. _end = . ;
  94. /* Debugging sections. */
  95. STABS_DEBUG
  96. DWARF_DEBUG
  97. /* Sections to be discarded */
  98. DISCARDS
  99. }