vmlinux.lds.S 3.9 KB

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