vmlinux.lds.S 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #include <linux/config.h>
  2. #include <asm/asm-offsets.h>
  3. #include <asm-generic/vmlinux.lds.h>
  4. #undef mips /* CPP really sucks for this job */
  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. . = ALIGN(_PAGE_SIZE);
  93. __initramfs_start = .;
  94. .init.ramfs : { *(.init.ramfs) }
  95. __initramfs_end = .;
  96. . = ALIGN(32);
  97. __per_cpu_start = .;
  98. .data.percpu : { *(.data.percpu) }
  99. __per_cpu_end = .;
  100. . = ALIGN(_PAGE_SIZE);
  101. __init_end = .;
  102. /* freed after init ends here */
  103. __bss_start = .; /* BSS */
  104. .sbss : {
  105. *(.sbss)
  106. *(.scommon)
  107. }
  108. .bss : {
  109. *(.bss)
  110. *(COMMON)
  111. }
  112. __bss_stop = .;
  113. _end = . ;
  114. /* Sections to be discarded */
  115. /DISCARD/ : {
  116. *(.exit.text)
  117. *(.exit.data)
  118. *(.exitcall.exit)
  119. /* ABI crap starts here */
  120. *(.comment)
  121. *(.MIPS.options)
  122. *(.note)
  123. *(.options)
  124. *(.pdr)
  125. *(.reginfo)
  126. *(.mdebug*)
  127. }
  128. /* This is the MIPS specific mdebug section. */
  129. .mdebug : { *(.mdebug) }
  130. /* These are needed for ELF backends which have not yet been
  131. converted to the new style linker. */
  132. .stab 0 : { *(.stab) }
  133. .stabstr 0 : { *(.stabstr) }
  134. /* DWARF debug sections.
  135. Symbols in the .debug DWARF section are relative to the beginning of the
  136. section so we begin .debug at 0. It's not clear yet what needs to happen
  137. for the others. */
  138. .debug 0 : { *(.debug) }
  139. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  140. .debug_aranges 0 : { *(.debug_aranges) }
  141. .debug_pubnames 0 : { *(.debug_pubnames) }
  142. .debug_sfnames 0 : { *(.debug_sfnames) }
  143. .line 0 : { *(.line) }
  144. /* These must appear regardless of . */
  145. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  146. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  147. .comment : { *(.comment) }
  148. .note : { *(.note) }
  149. }