dyn.lds.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start
  12. * is remapped.*/
  13. __binary_start = .;
  14. . = ALIGN(4096); /* Init code and data */
  15. _stext = .;
  16. __init_begin = .;
  17. .init.text : {
  18. _sinittext = .;
  19. *(.init.text)
  20. _einittext = .;
  21. }
  22. . = ALIGN(4096);
  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)
  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(4096);
  68. __syscall_stub_start = .;
  69. *(.__syscall_stub*)
  70. __syscall_stub_end = .;
  71. . = ALIGN(4096);
  72. } =0x90909090
  73. .fini : {
  74. KEEP (*(.fini))
  75. } =0x90909090
  76. .kstrtab : { *(.kstrtab) }
  77. #include "asm/common.lds.S"
  78. init.data : { *(.init.data) }
  79. /* Ensure the __preinit_array_start label is properly aligned. We
  80. could instead move the label definition inside the section, but
  81. the linker would then create the section even if it turns out to
  82. be empty, which isn't pretty. */
  83. . = ALIGN(32 / 8);
  84. .preinit_array : { *(.preinit_array) }
  85. .init_array : { *(.init_array) }
  86. .fini_array : { *(.fini_array) }
  87. .data : {
  88. . = ALIGN(KERNEL_STACK_SIZE); /* init_task */
  89. *(.data.init_task)
  90. *(.data .data.* .gnu.linkonce.d.*)
  91. SORT(CONSTRUCTORS)
  92. }
  93. .data1 : { *(.data1) }
  94. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  95. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  96. .eh_frame : { KEEP (*(.eh_frame)) }
  97. .gcc_except_table : { *(.gcc_except_table) }
  98. .dynamic : { *(.dynamic) }
  99. .ctors : {
  100. /* gcc uses crtbegin.o to find the start of
  101. the constructors, so we make sure it is
  102. first. Because this is a wildcard, it
  103. doesn't matter if the user does not
  104. actually link against crtbegin.o; the
  105. linker won't look for a file to match a
  106. wildcard. The wildcard also means that it
  107. doesn't matter which directory crtbegin.o
  108. is in. */
  109. KEEP (*crtbegin.o(.ctors))
  110. /* We don't want to include the .ctor section from
  111. from the crtend.o file until after the sorted ctors.
  112. The .ctor section from the crtend file contains the
  113. end of ctors marker and it must be last */
  114. KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
  115. KEEP (*(SORT(.ctors.*)))
  116. KEEP (*(.ctors))
  117. }
  118. .dtors : {
  119. KEEP (*crtbegin.o(.dtors))
  120. KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
  121. KEEP (*(SORT(.dtors.*)))
  122. KEEP (*(.dtors))
  123. }
  124. .jcr : { KEEP (*(.jcr)) }
  125. .got : { *(.got.plt) *(.got) }
  126. _edata = .;
  127. PROVIDE (edata = .);
  128. __bss_start = .;
  129. .bss : {
  130. *(.dynbss)
  131. *(.bss .bss.* .gnu.linkonce.b.*)
  132. *(COMMON)
  133. /* Align here to ensure that the .bss section occupies space up to
  134. _end. Align after .bss to ensure correct alignment even if the
  135. .bss section disappears because there are no input sections. */
  136. . = ALIGN(32 / 8);
  137. . = ALIGN(32 / 8);
  138. }
  139. _end = .;
  140. PROVIDE (end = .);
  141. STABS_DEBUG
  142. DWARF_DEBUG
  143. }