vmlinux.lds.S 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. *(.fixup)
  35. *(.gnu.warning)
  36. } :text = 0
  37. _etext = .; /* End of text section */
  38. /* Exception table */
  39. . = ALIGN(16);
  40. __ex_table : {
  41. __start___ex_table = .;
  42. *(__ex_table)
  43. __stop___ex_table = .;
  44. }
  45. /* Exception table for data bus errors */
  46. __dbe_table : {
  47. __start___dbe_table = .;
  48. *(__dbe_table)
  49. __stop___dbe_table = .;
  50. }
  51. NOTES :text :note
  52. .dummy : { *(.dummy) } :text
  53. RODATA
  54. /* writeable */
  55. .data : { /* Data */
  56. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  57. /*
  58. * This ALIGN is needed as a workaround for a bug a
  59. * gcc bug upto 4.1 which limits the maximum alignment
  60. * to at most 32kB and results in the following
  61. * warning:
  62. *
  63. * CC arch/mips/kernel/init_task.o
  64. * arch/mips/kernel/init_task.c:30: warning: alignment
  65. * of ‘init_thread_union’ is greater than maximum
  66. * object file alignment. Using 32768
  67. */
  68. . = ALIGN(_PAGE_SIZE);
  69. *(.data.init_task)
  70. DATA_DATA
  71. CONSTRUCTORS
  72. }
  73. _gp = . + 0x8000;
  74. .lit8 : {
  75. *(.lit8)
  76. }
  77. .lit4 : {
  78. *(.lit4)
  79. }
  80. /* We want the small data sections together, so single-instruction offsets
  81. can access them all, and initialized data all before uninitialized, so
  82. we can shorten the on-disk segment size. */
  83. .sdata : {
  84. *(.sdata)
  85. }
  86. . = ALIGN(_PAGE_SIZE);
  87. .data_nosave : {
  88. __nosave_begin = .;
  89. *(.data.nosave)
  90. }
  91. . = ALIGN(_PAGE_SIZE);
  92. __nosave_end = .;
  93. . = ALIGN(32);
  94. .data.cacheline_aligned : {
  95. *(.data.cacheline_aligned)
  96. }
  97. _edata = .; /* End of data section */
  98. /* will be freed after init */
  99. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  100. __init_begin = .;
  101. .init.text : {
  102. _sinittext = .;
  103. INIT_TEXT
  104. _einittext = .;
  105. }
  106. .init.data : {
  107. INIT_DATA
  108. }
  109. . = ALIGN(16);
  110. .init.setup : {
  111. __setup_start = .;
  112. *(.init.setup)
  113. __setup_end = .;
  114. }
  115. .initcall.init : {
  116. __initcall_start = .;
  117. INITCALLS
  118. __initcall_end = .;
  119. }
  120. .con_initcall.init : {
  121. __con_initcall_start = .;
  122. *(.con_initcall.init)
  123. __con_initcall_end = .;
  124. }
  125. SECURITY_INIT
  126. /* .exit.text is discarded at runtime, not link time, to deal with
  127. * references from .rodata
  128. */
  129. .exit.text : {
  130. EXIT_TEXT
  131. }
  132. .exit.data : {
  133. EXIT_DATA
  134. }
  135. #if defined(CONFIG_BLK_DEV_INITRD)
  136. . = ALIGN(_PAGE_SIZE);
  137. .init.ramfs : {
  138. __initramfs_start = .;
  139. *(.init.ramfs)
  140. __initramfs_end = .;
  141. }
  142. #endif
  143. PERCPU(_PAGE_SIZE)
  144. . = ALIGN(_PAGE_SIZE);
  145. __init_end = .;
  146. /* freed after init ends here */
  147. __bss_start = .; /* BSS */
  148. .sbss : {
  149. *(.sbss)
  150. *(.scommon)
  151. }
  152. .bss : {
  153. *(.bss)
  154. *(COMMON)
  155. }
  156. __bss_stop = .;
  157. _end = . ;
  158. /* Sections to be discarded */
  159. /DISCARD/ : {
  160. *(.exitcall.exit)
  161. /* ABI crap starts here */
  162. *(.MIPS.options)
  163. *(.options)
  164. *(.pdr)
  165. *(.reginfo)
  166. }
  167. /* These mark the ABI of the kernel for debuggers. */
  168. .mdebug.abi32 : {
  169. KEEP(*(.mdebug.abi32))
  170. }
  171. .mdebug.abi64 : {
  172. KEEP(*(.mdebug.abi64))
  173. }
  174. /* This is the MIPS specific mdebug section. */
  175. .mdebug : {
  176. *(.mdebug)
  177. }
  178. STABS_DEBUG
  179. DWARF_DEBUG
  180. /* These must appear regardless of . */
  181. .gptab.sdata : {
  182. *(.gptab.data)
  183. *(.gptab.sdata)
  184. }
  185. .gptab.sbss : {
  186. *(.gptab.bss)
  187. *(.gptab.sbss)
  188. }
  189. }