vmlinux.lds.S 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. #include <linux/config.h>
  2. #include <asm/asm-offsets.h>
  3. #include <asm-generic/vmlinux.lds.h>
  4. #undef mips
  5. #define mips mips
  6. OUTPUT_ARCH(mips)
  7. ENTRY(kernel_entry)
  8. jiffies = JIFFIES;
  9. SECTIONS
  10. {
  11. #ifdef CONFIG_BOOT_ELF64
  12. /* Read-only sections, merged into text segment: */
  13. /* . = 0xc000000000000000; */
  14. /* This is the value for an Origin kernel, taken from an IRIX kernel. */
  15. /* . = 0xc00000000001c000; */
  16. /* Set the vaddr for the text segment to a value
  17. >= 0xa800 0000 0001 9000 if no symmon is going to configured
  18. >= 0xa800 0000 0030 0000 otherwise */
  19. /* . = 0xa800000000300000; */
  20. /* . = 0xa800000000300000; */
  21. . = 0xffffffff80300000;
  22. #endif
  23. . = LOADADDR;
  24. /* read-only */
  25. _text = .; /* Text and read-only data */
  26. .text : {
  27. *(.text)
  28. SCHED_TEXT
  29. LOCK_TEXT
  30. *(.fixup)
  31. *(.gnu.warning)
  32. } =0
  33. _etext = .; /* End of text section */
  34. . = ALIGN(16); /* Exception table */
  35. __start___ex_table = .;
  36. __ex_table : { *(__ex_table) }
  37. __stop___ex_table = .;
  38. __start___dbe_table = .; /* Exception table for data bus errors */
  39. __dbe_table : { *(__dbe_table) }
  40. __stop___dbe_table = .;
  41. RODATA
  42. /* writeable */
  43. .data : { /* Data */
  44. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  45. *(.data.init_task)
  46. *(.data)
  47. CONSTRUCTORS
  48. }
  49. _gp = . + 0x8000;
  50. .lit8 : { *(.lit8) }
  51. .lit4 : { *(.lit4) }
  52. /* We want the small data sections together, so single-instruction offsets
  53. can access them all, and initialized data all before uninitialized, so
  54. we can shorten the on-disk segment size. */
  55. .sdata : { *(.sdata) }
  56. . = ALIGN(_PAGE_SIZE);
  57. __nosave_begin = .;
  58. .data_nosave : { *(.data.nosave) }
  59. . = ALIGN(_PAGE_SIZE);
  60. __nosave_end = .;
  61. . = ALIGN(32);
  62. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  63. _edata = .; /* End of data section */
  64. /* will be freed after init */
  65. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  66. __init_begin = .;
  67. .init.text : {
  68. _sinittext = .;
  69. *(.init.text)
  70. _einittext = .;
  71. }
  72. .init.data : { *(.init.data) }
  73. . = ALIGN(16);
  74. __setup_start = .;
  75. .init.setup : { *(.init.setup) }
  76. __setup_end = .;
  77. __initcall_start = .;
  78. .initcall.init : {
  79. *(.initcall1.init)
  80. *(.initcall2.init)
  81. *(.initcall3.init)
  82. *(.initcall4.init)
  83. *(.initcall5.init)
  84. *(.initcall6.init)
  85. *(.initcall7.init)
  86. }
  87. __initcall_end = .;
  88. __con_initcall_start = .;
  89. .con_initcall.init : { *(.con_initcall.init) }
  90. __con_initcall_end = .;
  91. SECURITY_INIT
  92. /* .exit.text is discarded at runtime, not link time, to deal with
  93. references from .rodata */
  94. .exit.text : { *(.exit.text) }
  95. . = ALIGN(_PAGE_SIZE);
  96. __initramfs_start = .;
  97. .init.ramfs : { *(.init.ramfs) }
  98. __initramfs_end = .;
  99. . = ALIGN(32);
  100. __per_cpu_start = .;
  101. .data.percpu : { *(.data.percpu) }
  102. __per_cpu_end = .;
  103. . = ALIGN(_PAGE_SIZE);
  104. __init_end = .;
  105. /* freed after init ends here */
  106. __bss_start = .; /* BSS */
  107. .sbss : {
  108. *(.sbss)
  109. *(.scommon)
  110. }
  111. .bss : {
  112. *(.bss)
  113. *(COMMON)
  114. }
  115. __bss_stop = .;
  116. _end = . ;
  117. /* Sections to be discarded */
  118. /DISCARD/ : {
  119. *(.exit.data)
  120. *(.exitcall.exit)
  121. /* ABI crap starts here */
  122. *(.comment)
  123. *(.MIPS.options)
  124. *(.note)
  125. *(.options)
  126. *(.pdr)
  127. *(.reginfo)
  128. *(.mdebug*)
  129. }
  130. /* This is the MIPS specific mdebug section. */
  131. .mdebug : { *(.mdebug) }
  132. /* These are needed for ELF backends which have not yet been
  133. converted to the new style linker. */
  134. .stab 0 : { *(.stab) }
  135. .stabstr 0 : { *(.stabstr) }
  136. /* DWARF debug sections.
  137. Symbols in the .debug DWARF section are relative to the beginning of the
  138. section so we begin .debug at 0. It's not clear yet what needs to happen
  139. for the others. */
  140. .debug 0 : { *(.debug) }
  141. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  142. .debug_aranges 0 : { *(.debug_aranges) }
  143. .debug_pubnames 0 : { *(.debug_pubnames) }
  144. .debug_sfnames 0 : { *(.debug_sfnames) }
  145. .line 0 : { *(.line) }
  146. /* These must appear regardless of . */
  147. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  148. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  149. .comment : { *(.comment) }
  150. .note : { *(.note) }
  151. }