dyn.lds.S 5.0 KB

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