vmlinux.lds.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. #include <asm/asm-offsets.h>
  2. #include <asm-generic/vmlinux.lds.h>
  3. #undef mips
  4. #define mips mips
  5. OUTPUT_ARCH(mips)
  6. ENTRY(kernel_entry)
  7. PHDRS {
  8. text PT_LOAD FLAGS(7); /* RWX */
  9. note PT_NOTE FLAGS(4); /* R__ */
  10. }
  11. jiffies = JIFFIES;
  12. SECTIONS
  13. {
  14. #ifdef CONFIG_BOOT_ELF64
  15. /* Read-only sections, merged into text segment: */
  16. /* . = 0xc000000000000000; */
  17. /* This is the value for an Origin kernel, taken from an IRIX kernel. */
  18. /* . = 0xc00000000001c000; */
  19. /* Set the vaddr for the text segment to a value
  20. * >= 0xa800 0000 0001 9000 if no symmon is going to configured
  21. * >= 0xa800 0000 0030 0000 otherwise
  22. */
  23. /* . = 0xa800000000300000; */
  24. . = 0xffffffff80300000;
  25. #endif
  26. . = LOADADDR;
  27. /* read-only */
  28. _text = .; /* Text and read-only data */
  29. .text : {
  30. TEXT_TEXT
  31. SCHED_TEXT
  32. LOCK_TEXT
  33. KPROBES_TEXT
  34. *(.text.*)
  35. *(.fixup)
  36. *(.gnu.warning)
  37. } :text = 0
  38. _etext = .; /* End of text section */
  39. /* Exception table */
  40. . = ALIGN(16);
  41. __ex_table : {
  42. __start___ex_table = .;
  43. *(__ex_table)
  44. __stop___ex_table = .;
  45. }
  46. /* Exception table for data bus errors */
  47. __dbe_table : {
  48. __start___dbe_table = .;
  49. *(__dbe_table)
  50. __stop___dbe_table = .;
  51. }
  52. NOTES :text :note
  53. .dummy : { *(.dummy) } :text
  54. RODATA
  55. /* writeable */
  56. .data : { /* Data */
  57. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  58. /*
  59. * This ALIGN is needed as a workaround for a bug a
  60. * gcc bug upto 4.1 which limits the maximum alignment
  61. * to at most 32kB and results in the following
  62. * warning:
  63. *
  64. * CC arch/mips/kernel/init_task.o
  65. * arch/mips/kernel/init_task.c:30: warning: alignment
  66. * of ‘init_thread_union’ is greater than maximum
  67. * object file alignment. Using 32768
  68. */
  69. . = ALIGN(_PAGE_SIZE);
  70. *(.data.init_task)
  71. DATA_DATA
  72. CONSTRUCTORS
  73. }
  74. _gp = . + 0x8000;
  75. .lit8 : {
  76. *(.lit8)
  77. }
  78. .lit4 : {
  79. *(.lit4)
  80. }
  81. /* We want the small data sections together, so single-instruction offsets
  82. can access them all, and initialized data all before uninitialized, so
  83. we can shorten the on-disk segment size. */
  84. .sdata : {
  85. *(.sdata)
  86. }
  87. . = ALIGN(_PAGE_SIZE);
  88. .data_nosave : {
  89. __nosave_begin = .;
  90. *(.data.nosave)
  91. }
  92. . = ALIGN(_PAGE_SIZE);
  93. __nosave_end = .;
  94. . = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
  95. .data.cacheline_aligned : {
  96. *(.data.cacheline_aligned)
  97. }
  98. _edata = .; /* End of data section */
  99. /* will be freed after init */
  100. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  101. __init_begin = .;
  102. .init.text : {
  103. _sinittext = .;
  104. INIT_TEXT
  105. _einittext = .;
  106. }
  107. .init.data : {
  108. INIT_DATA
  109. }
  110. . = ALIGN(16);
  111. .init.setup : {
  112. __setup_start = .;
  113. *(.init.setup)
  114. __setup_end = .;
  115. }
  116. .initcall.init : {
  117. __initcall_start = .;
  118. INITCALLS
  119. __initcall_end = .;
  120. }
  121. .con_initcall.init : {
  122. __con_initcall_start = .;
  123. *(.con_initcall.init)
  124. __con_initcall_end = .;
  125. }
  126. SECURITY_INIT
  127. /* .exit.text is discarded at runtime, not link time, to deal with
  128. * references from .rodata
  129. */
  130. .exit.text : {
  131. EXIT_TEXT
  132. }
  133. .exit.data : {
  134. EXIT_DATA
  135. }
  136. #if defined(CONFIG_BLK_DEV_INITRD)
  137. . = ALIGN(_PAGE_SIZE);
  138. .init.ramfs : {
  139. __initramfs_start = .;
  140. *(.init.ramfs)
  141. __initramfs_end = .;
  142. }
  143. #endif
  144. PERCPU(_PAGE_SIZE)
  145. . = ALIGN(_PAGE_SIZE);
  146. __init_end = .;
  147. /* freed after init ends here */
  148. __bss_start = .; /* BSS */
  149. .sbss : {
  150. *(.sbss)
  151. *(.scommon)
  152. }
  153. .bss : {
  154. *(.bss)
  155. *(COMMON)
  156. }
  157. __bss_stop = .;
  158. _end = . ;
  159. /* Sections to be discarded */
  160. /DISCARD/ : {
  161. *(.exitcall.exit)
  162. /* ABI crap starts here */
  163. *(.MIPS.options)
  164. *(.options)
  165. *(.pdr)
  166. *(.reginfo)
  167. }
  168. /* These mark the ABI of the kernel for debuggers. */
  169. .mdebug.abi32 : {
  170. KEEP(*(.mdebug.abi32))
  171. }
  172. .mdebug.abi64 : {
  173. KEEP(*(.mdebug.abi64))
  174. }
  175. /* This is the MIPS specific mdebug section. */
  176. .mdebug : {
  177. *(.mdebug)
  178. }
  179. STABS_DEBUG
  180. DWARF_DEBUG
  181. /* These must appear regardless of . */
  182. .gptab.sdata : {
  183. *(.gptab.data)
  184. *(.gptab.sdata)
  185. }
  186. .gptab.sbss : {
  187. *(.gptab.bss)
  188. *(.gptab.sbss)
  189. }
  190. }