vmlinux.lds.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. EXCEPTION_TABLE(8)
  52. _etext = .; /* End of text and rodata section */
  53. . = ALIGN(PAGE_SIZE);
  54. __init_begin = .;
  55. INIT_TEXT_SECTION(8)
  56. .exit.text : {
  57. ARM_EXIT_KEEP(EXIT_TEXT)
  58. }
  59. . = ALIGN(16);
  60. .init.data : {
  61. INIT_DATA
  62. INIT_SETUP(16)
  63. INIT_CALLS
  64. CON_INITCALL
  65. SECURITY_INITCALL
  66. INIT_RAM_FS
  67. }
  68. .exit.data : {
  69. ARM_EXIT_KEEP(EXIT_DATA)
  70. }
  71. PERCPU_SECTION(64)
  72. __init_end = .;
  73. . = ALIGN(THREAD_SIZE);
  74. __data_loc = .;
  75. .data : AT(__data_loc) {
  76. _data = .; /* address in memory */
  77. _sdata = .;
  78. /*
  79. * first, the init task union, aligned
  80. * to an 8192 byte boundary.
  81. */
  82. INIT_TASK_DATA(THREAD_SIZE)
  83. NOSAVE_DATA
  84. CACHELINE_ALIGNED_DATA(64)
  85. READ_MOSTLY_DATA(64)
  86. /*
  87. * and the usual data section
  88. */
  89. DATA_DATA
  90. CONSTRUCTORS
  91. _edata = .;
  92. }
  93. _edata_loc = __data_loc + SIZEOF(.data);
  94. NOTES
  95. BSS_SECTION(0, 0, 0)
  96. _end = .;
  97. STABS_DEBUG
  98. .comment 0 : { *(.comment) }
  99. }