dyn.lds.S 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #include <asm/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. CPUIDLE_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_begin = .;
  87. init.data : { INIT_DATA }
  88. __init_end = .;
  89. /* Ensure the __preinit_array_start label is properly aligned. We
  90. could instead move the label definition inside the section, but
  91. the linker would then create the section even if it turns out to
  92. be empty, which isn't pretty. */
  93. . = ALIGN(32 / 8);
  94. .preinit_array : { *(.preinit_array) }
  95. .init_array : { *(.init_array) }
  96. .fini_array : { *(.fini_array) }
  97. .data : {
  98. INIT_TASK_DATA(KERNEL_STACK_SIZE)
  99. . = ALIGN(KERNEL_STACK_SIZE);
  100. *(.data..init_irqstack)
  101. DATA_DATA
  102. *(.data.* .gnu.linkonce.d.*)
  103. SORT(CONSTRUCTORS)
  104. }
  105. .data1 : { *(.data1) }
  106. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  107. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  108. .eh_frame : { KEEP (*(.eh_frame)) }
  109. .gcc_except_table : { *(.gcc_except_table) }
  110. .dynamic : { *(.dynamic) }
  111. .ctors : {
  112. /* gcc uses crtbegin.o to find the start of
  113. the constructors, so we make sure it is
  114. first. Because this is a wildcard, it
  115. doesn't matter if the user does not
  116. actually link against crtbegin.o; the
  117. linker won't look for a file to match a
  118. wildcard. The wildcard also means that it
  119. doesn't matter which directory crtbegin.o
  120. is in. */
  121. KEEP (*crtbegin.o(.ctors))
  122. /* We don't want to include the .ctor section from
  123. from the crtend.o file until after the sorted ctors.
  124. The .ctor section from the crtend file contains the
  125. end of ctors marker and it must be last */
  126. KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
  127. KEEP (*(SORT(.ctors.*)))
  128. KEEP (*(.ctors))
  129. }
  130. .dtors : {
  131. KEEP (*crtbegin.o(.dtors))
  132. KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
  133. KEEP (*(SORT(.dtors.*)))
  134. KEEP (*(.dtors))
  135. }
  136. .jcr : { KEEP (*(.jcr)) }
  137. .got : { *(.got.plt) *(.got) }
  138. _edata = .;
  139. PROVIDE (edata = .);
  140. .bss : {
  141. __bss_start = .;
  142. *(.dynbss)
  143. *(.bss .bss.* .gnu.linkonce.b.*)
  144. *(COMMON)
  145. /* Align here to ensure that the .bss section occupies space up to
  146. _end. Align after .bss to ensure correct alignment even if the
  147. .bss section disappears because there are no input sections. */
  148. . = ALIGN(32 / 8);
  149. . = ALIGN(32 / 8);
  150. }
  151. __bss_stop = .;
  152. _end = .;
  153. PROVIDE (end = .);
  154. STABS_DEBUG
  155. DWARF_DEBUG
  156. DISCARDS
  157. }