vmlinux.lds.S 3.7 KB

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