dyn.lds.S 5.1 KB

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