vmlinux.lds.S 3.8 KB

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