vmlinux.lds.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * ld script to make ARM Linux kernel
  3. * taken from the i386 version by Russell King
  4. * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  5. */
  6. #include <asm-generic/vmlinux.lds.h>
  7. #include <asm/thread_info.h>
  8. #include <asm/memory.h>
  9. #include <asm/page.h>
  10. #define ARM_EXIT_KEEP(x)
  11. #define ARM_EXIT_DISCARD(x) x
  12. OUTPUT_ARCH(aarch64)
  13. ENTRY(stext)
  14. jiffies = jiffies_64;
  15. #define HYPERVISOR_TEXT \
  16. /* \
  17. * Force the alignment to be compatible with \
  18. * the vectors requirements \
  19. */ \
  20. . = ALIGN(2048); \
  21. VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
  22. *(.hyp.idmap.text) \
  23. VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \
  24. VMLINUX_SYMBOL(__hyp_text_start) = .; \
  25. *(.hyp.text) \
  26. VMLINUX_SYMBOL(__hyp_text_end) = .;
  27. SECTIONS
  28. {
  29. /*
  30. * XXX: The linker does not define how output sections are
  31. * assigned to input sections when there are multiple statements
  32. * matching the same input section name. There is no documented
  33. * order of matching.
  34. */
  35. /DISCARD/ : {
  36. ARM_EXIT_DISCARD(EXIT_TEXT)
  37. ARM_EXIT_DISCARD(EXIT_DATA)
  38. EXIT_CALL
  39. *(.discard)
  40. *(.discard.*)
  41. }
  42. . = PAGE_OFFSET + TEXT_OFFSET;
  43. .head.text : {
  44. _text = .;
  45. HEAD_TEXT
  46. }
  47. .text : { /* Real text segment */
  48. _stext = .; /* Text and read-only data */
  49. *(.smp.pen.text)
  50. __exception_text_start = .;
  51. *(.exception.text)
  52. __exception_text_end = .;
  53. IRQENTRY_TEXT
  54. TEXT_TEXT
  55. SCHED_TEXT
  56. LOCK_TEXT
  57. HYPERVISOR_TEXT
  58. *(.fixup)
  59. *(.gnu.warning)
  60. . = ALIGN(16);
  61. *(.got) /* Global offset table */
  62. }
  63. RO_DATA(PAGE_SIZE)
  64. EXCEPTION_TABLE(8)
  65. _etext = .; /* End of text and rodata section */
  66. . = ALIGN(PAGE_SIZE);
  67. __init_begin = .;
  68. INIT_TEXT_SECTION(8)
  69. .exit.text : {
  70. ARM_EXIT_KEEP(EXIT_TEXT)
  71. }
  72. . = ALIGN(16);
  73. .init.data : {
  74. INIT_DATA
  75. INIT_SETUP(16)
  76. INIT_CALLS
  77. CON_INITCALL
  78. SECURITY_INITCALL
  79. INIT_RAM_FS
  80. }
  81. .exit.data : {
  82. ARM_EXIT_KEEP(EXIT_DATA)
  83. }
  84. PERCPU_SECTION(64)
  85. __init_end = .;
  86. . = ALIGN(THREAD_SIZE);
  87. __data_loc = .;
  88. .data : AT(__data_loc) {
  89. _data = .; /* address in memory */
  90. _sdata = .;
  91. /*
  92. * first, the init task union, aligned
  93. * to an 8192 byte boundary.
  94. */
  95. INIT_TASK_DATA(THREAD_SIZE)
  96. NOSAVE_DATA
  97. CACHELINE_ALIGNED_DATA(64)
  98. READ_MOSTLY_DATA(64)
  99. /*
  100. * and the usual data section
  101. */
  102. DATA_DATA
  103. CONSTRUCTORS
  104. _edata = .;
  105. }
  106. _edata_loc = __data_loc + SIZEOF(.data);
  107. NOTES
  108. BSS_SECTION(0, 0, 0)
  109. _end = .;
  110. STABS_DEBUG
  111. .comment 0 : { *(.comment) }
  112. }
  113. /*
  114. * The HYP init code can't be more than a page long.
  115. */
  116. ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end),
  117. "HYP init code too big")