vmlinux.lds.S 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* ld script to make i386 Linux kernel
  2. * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
  3. */
  4. #include <asm-generic/vmlinux.lds.h>
  5. #include <asm/thread_info.h>
  6. #include <asm/page.h>
  7. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  8. OUTPUT_ARCH(i386)
  9. ENTRY(startup_32)
  10. jiffies = jiffies_64;
  11. SECTIONS
  12. {
  13. . = __PAGE_OFFSET + 0x100000;
  14. /* read-only */
  15. _text = .; /* Text and read-only data */
  16. .text : {
  17. *(.text)
  18. SCHED_TEXT
  19. LOCK_TEXT
  20. *(.fixup)
  21. *(.gnu.warning)
  22. } = 0x9090
  23. _etext = .; /* End of text section */
  24. . = ALIGN(16); /* Exception table */
  25. __start___ex_table = .;
  26. __ex_table : { *(__ex_table) }
  27. __stop___ex_table = .;
  28. RODATA
  29. /* writeable */
  30. .data : { /* Data */
  31. *(.data)
  32. CONSTRUCTORS
  33. }
  34. . = ALIGN(4096);
  35. __nosave_begin = .;
  36. .data_nosave : { *(.data.nosave) }
  37. . = ALIGN(4096);
  38. __nosave_end = .;
  39. . = ALIGN(4096);
  40. .data.page_aligned : { *(.data.idt) }
  41. . = ALIGN(32);
  42. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  43. _edata = .; /* End of data section */
  44. . = ALIGN(THREAD_SIZE); /* init_task */
  45. .data.init_task : { *(.data.init_task) }
  46. /* will be freed after init */
  47. . = ALIGN(4096); /* Init code and data */
  48. __init_begin = .;
  49. .init.text : {
  50. _sinittext = .;
  51. *(.init.text)
  52. _einittext = .;
  53. }
  54. .init.data : { *(.init.data) }
  55. . = ALIGN(16);
  56. __setup_start = .;
  57. .init.setup : { *(.init.setup) }
  58. __setup_end = .;
  59. __initcall_start = .;
  60. .initcall.init : {
  61. *(.initcall1.init)
  62. *(.initcall2.init)
  63. *(.initcall3.init)
  64. *(.initcall4.init)
  65. *(.initcall5.init)
  66. *(.initcall6.init)
  67. *(.initcall7.init)
  68. }
  69. __initcall_end = .;
  70. __con_initcall_start = .;
  71. .con_initcall.init : { *(.con_initcall.init) }
  72. __con_initcall_end = .;
  73. SECURITY_INIT
  74. . = ALIGN(4);
  75. __alt_instructions = .;
  76. .altinstructions : { *(.altinstructions) }
  77. __alt_instructions_end = .;
  78. .altinstr_replacement : { *(.altinstr_replacement) }
  79. /* .exit.text is discard at runtime, not link time, to deal with references
  80. from .altinstructions and .eh_frame */
  81. .exit.text : { *(.exit.text) }
  82. .exit.data : { *(.exit.data) }
  83. . = ALIGN(4096);
  84. __initramfs_start = .;
  85. .init.ramfs : { *(.init.ramfs) }
  86. __initramfs_end = .;
  87. . = ALIGN(32);
  88. __per_cpu_start = .;
  89. .data.percpu : { *(.data.percpu) }
  90. __per_cpu_end = .;
  91. . = ALIGN(4096);
  92. __init_end = .;
  93. /* freed after init ends here */
  94. __bss_start = .; /* BSS */
  95. .bss : {
  96. *(.bss.page_aligned)
  97. *(.bss)
  98. }
  99. . = ALIGN(4);
  100. __bss_stop = .;
  101. _end = . ;
  102. /* This is where the kernel creates the early boot page tables */
  103. . = ALIGN(4096);
  104. pg0 = .;
  105. /* Sections to be discarded */
  106. /DISCARD/ : {
  107. *(.exitcall.exit)
  108. }
  109. /* Stabs debugging sections. */
  110. .stab 0 : { *(.stab) }
  111. .stabstr 0 : { *(.stabstr) }
  112. .stab.excl 0 : { *(.stab.excl) }
  113. .stab.exclstr 0 : { *(.stab.exclstr) }
  114. .stab.index 0 : { *(.stab.index) }
  115. .stab.indexstr 0 : { *(.stab.indexstr) }
  116. .comment 0 : { *(.comment) }
  117. }