dyn.lds.S 5.1 KB

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