vmlinux.lds.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. SECTIONS
  16. {
  17. /*
  18. * XXX: The linker does not define how output sections are
  19. * assigned to input sections when there are multiple statements
  20. * matching the same input section name. There is no documented
  21. * order of matching.
  22. */
  23. /DISCARD/ : {
  24. ARM_EXIT_DISCARD(EXIT_TEXT)
  25. ARM_EXIT_DISCARD(EXIT_DATA)
  26. EXIT_CALL
  27. *(.discard)
  28. *(.discard.*)
  29. }
  30. . = PAGE_OFFSET + TEXT_OFFSET;
  31. .head.text : {
  32. _text = .;
  33. HEAD_TEXT
  34. }
  35. .text : { /* Real text segment */
  36. _stext = .; /* Text and read-only data */
  37. *(.smp.pen.text)
  38. __exception_text_start = .;
  39. *(.exception.text)
  40. __exception_text_end = .;
  41. IRQENTRY_TEXT
  42. TEXT_TEXT
  43. SCHED_TEXT
  44. LOCK_TEXT
  45. *(.fixup)
  46. *(.gnu.warning)
  47. . = ALIGN(16);
  48. *(.got) /* Global offset table */
  49. }
  50. RO_DATA(PAGE_SIZE)
  51. _etext = .; /* End of text and rodata section */
  52. . = ALIGN(PAGE_SIZE);
  53. __init_begin = .;
  54. INIT_TEXT_SECTION(8)
  55. .exit.text : {
  56. ARM_EXIT_KEEP(EXIT_TEXT)
  57. }
  58. . = ALIGN(16);
  59. .init.data : {
  60. INIT_DATA
  61. INIT_SETUP(16)
  62. INIT_CALLS
  63. CON_INITCALL
  64. SECURITY_INITCALL
  65. INIT_RAM_FS
  66. }
  67. .exit.data : {
  68. ARM_EXIT_KEEP(EXIT_DATA)
  69. }
  70. PERCPU_SECTION(64)
  71. __init_end = .;
  72. . = ALIGN(THREAD_SIZE);
  73. __data_loc = .;
  74. .data : AT(__data_loc) {
  75. _data = .; /* address in memory */
  76. _sdata = .;
  77. /*
  78. * first, the init task union, aligned
  79. * to an 8192 byte boundary.
  80. */
  81. INIT_TASK_DATA(THREAD_SIZE)
  82. NOSAVE_DATA
  83. CACHELINE_ALIGNED_DATA(64)
  84. READ_MOSTLY_DATA(64)
  85. /*
  86. * The exception fixup table (might need resorting at runtime)
  87. */
  88. . = ALIGN(32);
  89. __start___ex_table = .;
  90. *(__ex_table)
  91. __stop___ex_table = .;
  92. /*
  93. * and the usual data section
  94. */
  95. DATA_DATA
  96. CONSTRUCTORS
  97. _edata = .;
  98. }
  99. _edata_loc = __data_loc + SIZEOF(.data);
  100. NOTES
  101. BSS_SECTION(0, 0, 0)
  102. _end = .;
  103. STABS_DEBUG
  104. .comment 0 : { *(.comment) }
  105. }