vmlinux.lds.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. NOTES
  66. _etext = .; /* End of text and rodata section */
  67. . = ALIGN(PAGE_SIZE);
  68. __init_begin = .;
  69. INIT_TEXT_SECTION(8)
  70. .exit.text : {
  71. ARM_EXIT_KEEP(EXIT_TEXT)
  72. }
  73. . = ALIGN(16);
  74. .init.data : {
  75. INIT_DATA
  76. INIT_SETUP(16)
  77. INIT_CALLS
  78. CON_INITCALL
  79. SECURITY_INITCALL
  80. INIT_RAM_FS
  81. }
  82. .exit.data : {
  83. ARM_EXIT_KEEP(EXIT_DATA)
  84. }
  85. PERCPU_SECTION(64)
  86. __init_end = .;
  87. . = ALIGN(THREAD_SIZE);
  88. __data_loc = .;
  89. .data : AT(__data_loc) {
  90. _data = .; /* address in memory */
  91. _sdata = .;
  92. /*
  93. * first, the init task union, aligned
  94. * to an 8192 byte boundary.
  95. */
  96. INIT_TASK_DATA(THREAD_SIZE)
  97. NOSAVE_DATA
  98. CACHELINE_ALIGNED_DATA(64)
  99. READ_MOSTLY_DATA(64)
  100. /*
  101. * and the usual data section
  102. */
  103. DATA_DATA
  104. CONSTRUCTORS
  105. _edata = .;
  106. }
  107. _edata_loc = __data_loc + SIZEOF(.data);
  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")