dyn.lds.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #include <asm-generic/vmlinux.lds.h>
  2. OUTPUT_FORMAT(ELF_FORMAT)
  3. OUTPUT_ARCH(ELF_ARCH)
  4. ENTRY(_start)
  5. jiffies = jiffies_64;
  6. SECTIONS
  7. {
  8. PROVIDE (__executable_start = START);
  9. . = START + SIZEOF_HEADERS;
  10. .interp : { *(.interp) }
  11. __binary_start = .;
  12. . = ALIGN(4096); /* Init code and data */
  13. _text = .;
  14. _stext = .;
  15. __init_begin = .;
  16. .init.text : {
  17. _sinittext = .;
  18. *(.init.text)
  19. _einittext = .;
  20. }
  21. . = ALIGN(4096);
  22. /* Read-only sections, merged into text segment: */
  23. .hash : { *(.hash) }
  24. .gnu.hash : { *(.gnu.hash) }
  25. .dynsym : { *(.dynsym) }
  26. .dynstr : { *(.dynstr) }
  27. .gnu.version : { *(.gnu.version) }
  28. .gnu.version_d : { *(.gnu.version_d) }
  29. .gnu.version_r : { *(.gnu.version_r) }
  30. .rel.init : { *(.rel.init) }
  31. .rela.init : { *(.rela.init) }
  32. .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  33. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  34. .rel.fini : { *(.rel.fini) }
  35. .rela.fini : { *(.rela.fini) }
  36. .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  37. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  38. .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  39. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  40. .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  41. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  42. .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  43. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  44. .rel.ctors : { *(.rel.ctors) }
  45. .rela.ctors : { *(.rela.ctors) }
  46. .rel.dtors : { *(.rel.dtors) }
  47. .rela.dtors : { *(.rela.dtors) }
  48. .rel.got : { *(.rel.got) }
  49. .rela.got : { *(.rela.got) }
  50. .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  51. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  52. .rel.plt : { *(.rel.plt) }
  53. .rela.plt : { *(.rela.plt) }
  54. .init : {
  55. KEEP (*(.init))
  56. } =0x90909090
  57. .plt : { *(.plt) }
  58. .text : {
  59. TEXT_TEXT
  60. SCHED_TEXT
  61. LOCK_TEXT
  62. *(.fixup)
  63. *(.stub .text.* .gnu.linkonce.t.*)
  64. /* .gnu.warning sections are handled specially by elf32.em. */
  65. *(.gnu.warning)
  66. . = ALIGN(4096);
  67. } =0x90909090
  68. . = ALIGN(4096);
  69. .syscall_stub : {
  70. __syscall_stub_start = .;
  71. *(.__syscall_stub*)
  72. __syscall_stub_end = .;
  73. }
  74. .fini : {
  75. KEEP (*(.fini))
  76. } =0x90909090
  77. .kstrtab : { *(.kstrtab) }
  78. #include "asm/common.lds.S"
  79. init.data : { *(.init.data) }
  80. /* Ensure the __preinit_array_start label is properly aligned. We
  81. could instead move the label definition inside the section, but
  82. the linker would then create the section even if it turns out to
  83. be empty, which isn't pretty. */
  84. . = ALIGN(32 / 8);
  85. .preinit_array : { *(.preinit_array) }
  86. .init_array : { *(.init_array) }
  87. .fini_array : { *(.fini_array) }
  88. .data : {
  89. . = ALIGN(KERNEL_STACK_SIZE); /* init_task */
  90. *(.data.init_task)
  91. . = ALIGN(KERNEL_STACK_SIZE);
  92. *(.data.init_irqstack)
  93. DATA_DATA
  94. *(.data.* .gnu.linkonce.d.*)
  95. SORT(CONSTRUCTORS)
  96. }
  97. .data1 : { *(.data1) }
  98. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  99. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  100. .eh_frame : { KEEP (*(.eh_frame)) }
  101. .gcc_except_table : { *(.gcc_except_table) }
  102. .dynamic : { *(.dynamic) }
  103. .ctors : {
  104. /* gcc uses crtbegin.o to find the start of
  105. the constructors, so we make sure it is
  106. first. Because this is a wildcard, it
  107. doesn't matter if the user does not
  108. actually link against crtbegin.o; the
  109. linker won't look for a file to match a
  110. wildcard. The wildcard also means that it
  111. doesn't matter which directory crtbegin.o
  112. is in. */
  113. KEEP (*crtbegin.o(.ctors))
  114. /* We don't want to include the .ctor section from
  115. from the crtend.o file until after the sorted ctors.
  116. The .ctor section from the crtend file contains the
  117. end of ctors marker and it must be last */
  118. KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
  119. KEEP (*(SORT(.ctors.*)))
  120. KEEP (*(.ctors))
  121. }
  122. .dtors : {
  123. KEEP (*crtbegin.o(.dtors))
  124. KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
  125. KEEP (*(SORT(.dtors.*)))
  126. KEEP (*(.dtors))
  127. }
  128. .jcr : { KEEP (*(.jcr)) }
  129. .got : { *(.got.plt) *(.got) }
  130. _edata = .;
  131. PROVIDE (edata = .);
  132. .bss : {
  133. __bss_start = .;
  134. *(.dynbss)
  135. *(.bss .bss.* .gnu.linkonce.b.*)
  136. *(COMMON)
  137. /* Align here to ensure that the .bss section occupies space up to
  138. _end. Align after .bss to ensure correct alignment even if the
  139. .bss section disappears because there are no input sections. */
  140. . = ALIGN(32 / 8);
  141. . = ALIGN(32 / 8);
  142. }
  143. _end = .;
  144. PROVIDE (end = .);
  145. STABS_DEBUG
  146. DWARF_DEBUG
  147. }