dyn.lds.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 : { *(.rel.plt) }
  50. .rela.plt : { *(.rela.plt) }
  51. .init : {
  52. KEEP (*(.init))
  53. } =0x90909090
  54. .plt : { *(.plt) }
  55. .text : {
  56. TEXT_TEXT
  57. SCHED_TEXT
  58. LOCK_TEXT
  59. *(.fixup)
  60. *(.stub .text.* .gnu.linkonce.t.*)
  61. /* .gnu.warning sections are handled specially by elf32.em. */
  62. *(.gnu.warning)
  63. . = ALIGN(PAGE_SIZE);
  64. } =0x90909090
  65. . = ALIGN(PAGE_SIZE);
  66. .syscall_stub : {
  67. __syscall_stub_start = .;
  68. *(.__syscall_stub*)
  69. __syscall_stub_end = .;
  70. }
  71. .fini : {
  72. KEEP (*(.fini))
  73. } =0x90909090
  74. .kstrtab : { *(.kstrtab) }
  75. #include "asm/common.lds.S"
  76. init.data : { INIT_DATA }
  77. /* Ensure the __preinit_array_start label is properly aligned. We
  78. could instead move the label definition inside the section, but
  79. the linker would then create the section even if it turns out to
  80. be empty, which isn't pretty. */
  81. . = ALIGN(32 / 8);
  82. .preinit_array : { *(.preinit_array) }
  83. .init_array : { *(.init_array) }
  84. .fini_array : { *(.fini_array) }
  85. .data : {
  86. INIT_TASK_DATA(KERNEL_STACK_SIZE)
  87. . = ALIGN(KERNEL_STACK_SIZE);
  88. *(.data.init_irqstack)
  89. DATA_DATA
  90. *(.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 : {
  129. __bss_start = .;
  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. DISCARDS
  144. }