vmlinux.lds.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #include <linux/config.h>
  2. #include <asm-generic/vmlinux.lds.h>
  3. #undef mips /* CPP really sucks for this job */
  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. /* . = 0xa800000000300000; */
  19. /* . = 0xa800000000300000; */
  20. . = 0xffffffff80300000;
  21. #endif
  22. . = LOADADDR;
  23. /* read-only */
  24. _text = .; /* Text and read-only data */
  25. .text : {
  26. *(.text)
  27. SCHED_TEXT
  28. LOCK_TEXT
  29. *(.fixup)
  30. *(.gnu.warning)
  31. } =0
  32. _etext = .; /* End of text section */
  33. . = ALIGN(16); /* Exception table */
  34. __start___ex_table = .;
  35. __ex_table : { *(__ex_table) }
  36. __stop___ex_table = .;
  37. __start___dbe_table = .; /* Exception table for data bus errors */
  38. __dbe_table : { *(__dbe_table) }
  39. __stop___dbe_table = .;
  40. RODATA
  41. /* writeable */
  42. .data : { /* Data */
  43. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  44. *(.data.init_task)
  45. *(.data)
  46. /* Align the initial ramdisk image (INITRD) on page boundaries. */
  47. . = ALIGN(4096);
  48. __rd_start = .;
  49. *(.initrd)
  50. . = ALIGN(4096);
  51. __rd_end = .;
  52. CONSTRUCTORS
  53. }
  54. _gp = . + 0x8000;
  55. .lit8 : { *(.lit8) }
  56. .lit4 : { *(.lit4) }
  57. /* We want the small data sections together, so single-instruction offsets
  58. can access them all, and initialized data all before uninitialized, so
  59. we can shorten the on-disk segment size. */
  60. .sdata : { *(.sdata) }
  61. . = ALIGN(4096);
  62. __nosave_begin = .;
  63. .data_nosave : { *(.data.nosave) }
  64. . = ALIGN(4096);
  65. __nosave_end = .;
  66. . = ALIGN(32);
  67. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  68. _edata = .; /* End of data section */
  69. /* will be freed after init */
  70. . = ALIGN(4096); /* Init code and data */
  71. __init_begin = .;
  72. .init.text : {
  73. _sinittext = .;
  74. *(.init.text)
  75. _einittext = .;
  76. }
  77. .init.data : { *(.init.data) }
  78. . = ALIGN(16);
  79. __setup_start = .;
  80. .init.setup : { *(.init.setup) }
  81. __setup_end = .;
  82. .early_initcall.init : {
  83. __earlyinitcall_start = .;
  84. *(.initcall.early1.init)
  85. }
  86. __earlyinitcall_end = .;
  87. __initcall_start = .;
  88. .initcall.init : {
  89. *(.initcall1.init)
  90. *(.initcall2.init)
  91. *(.initcall3.init)
  92. *(.initcall4.init)
  93. *(.initcall5.init)
  94. *(.initcall6.init)
  95. *(.initcall7.init)
  96. }
  97. __initcall_end = .;
  98. __con_initcall_start = .;
  99. .con_initcall.init : { *(.con_initcall.init) }
  100. __con_initcall_end = .;
  101. SECURITY_INIT
  102. . = ALIGN(4096);
  103. __initramfs_start = .;
  104. .init.ramfs : { *(.init.ramfs) }
  105. __initramfs_end = .;
  106. . = ALIGN(32);
  107. __per_cpu_start = .;
  108. .data.percpu : { *(.data.percpu) }
  109. __per_cpu_end = .;
  110. . = ALIGN(4096);
  111. __init_end = .;
  112. /* freed after init ends here */
  113. __bss_start = .; /* BSS */
  114. .sbss : {
  115. *(.sbss)
  116. *(.scommon)
  117. }
  118. .bss : {
  119. *(.bss)
  120. *(COMMON)
  121. }
  122. __bss_stop = .;
  123. _end = . ;
  124. /* Sections to be discarded */
  125. /DISCARD/ : {
  126. *(.exit.text)
  127. *(.exit.data)
  128. *(.exitcall.exit)
  129. /* ABI crap starts here */
  130. *(.comment)
  131. *(.MIPS.options)
  132. *(.note)
  133. *(.options)
  134. *(.pdr)
  135. *(.reginfo)
  136. *(.mdebug*)
  137. }
  138. /* This is the MIPS specific mdebug section. */
  139. .mdebug : { *(.mdebug) }
  140. /* These are needed for ELF backends which have not yet been
  141. converted to the new style linker. */
  142. .stab 0 : { *(.stab) }
  143. .stabstr 0 : { *(.stabstr) }
  144. /* DWARF debug sections.
  145. Symbols in the .debug DWARF section are relative to the beginning of the
  146. section so we begin .debug at 0. It's not clear yet what needs to happen
  147. for the others. */
  148. .debug 0 : { *(.debug) }
  149. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  150. .debug_aranges 0 : { *(.debug_aranges) }
  151. .debug_pubnames 0 : { *(.debug_pubnames) }
  152. .debug_sfnames 0 : { *(.debug_sfnames) }
  153. .line 0 : { *(.line) }
  154. /* These must appear regardless of . */
  155. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  156. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  157. .comment : { *(.comment) }
  158. .note : { *(.note) }
  159. }