vmlinux.lds.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. _sdata = .; /* Start of data section */
  46. EXCEPTION_TABLE(16) :data
  47. RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
  48. _edata = .; /* End of data section */
  49. /* will be freed after init */
  50. . = ALIGN(PAGE_SIZE); /* Init code and data */
  51. __init_begin = .;
  52. INIT_TEXT_SECTION(PAGE_SIZE)
  53. /*
  54. * .exit.text is discarded at runtime, not link time,
  55. * to deal with references from __bug_table
  56. */
  57. .exit.text : {
  58. EXIT_TEXT
  59. }
  60. /* early.c uses stsi, which requires page aligned data. */
  61. . = ALIGN(PAGE_SIZE);
  62. INIT_DATA_SECTION(0x100)
  63. PERCPU_SECTION(0x100)
  64. . = ALIGN(PAGE_SIZE);
  65. __init_end = .; /* freed after init ends here */
  66. BSS_SECTION(0, 2, 0)
  67. _end = . ;
  68. /* Debugging sections. */
  69. STABS_DEBUG
  70. DWARF_DEBUG
  71. /* Sections to be discarded */
  72. DISCARDS
  73. }