vmlinux.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. /* . = 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. CONSTRUCTORS
  47. }
  48. _gp = . + 0x8000;
  49. .lit8 : { *(.lit8) }
  50. .lit4 : { *(.lit4) }
  51. /* We want the small data sections together, so single-instruction offsets
  52. can access them all, and initialized data all before uninitialized, so
  53. we can shorten the on-disk segment size. */
  54. .sdata : { *(.sdata) }
  55. . = ALIGN(_PAGE_SIZE);
  56. __nosave_begin = .;
  57. .data_nosave : { *(.data.nosave) }
  58. . = ALIGN(_PAGE_SIZE);
  59. __nosave_end = .;
  60. . = ALIGN(32);
  61. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  62. _edata = .; /* End of data section */
  63. /* will be freed after init */
  64. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  65. __init_begin = .;
  66. .init.text : {
  67. _sinittext = .;
  68. *(.init.text)
  69. _einittext = .;
  70. }
  71. .init.data : { *(.init.data) }
  72. . = ALIGN(16);
  73. __setup_start = .;
  74. .init.setup : { *(.init.setup) }
  75. __setup_end = .;
  76. __initcall_start = .;
  77. .initcall.init : {
  78. *(.initcall1.init)
  79. *(.initcall2.init)
  80. *(.initcall3.init)
  81. *(.initcall4.init)
  82. *(.initcall5.init)
  83. *(.initcall6.init)
  84. *(.initcall7.init)
  85. }
  86. __initcall_end = .;
  87. __con_initcall_start = .;
  88. .con_initcall.init : { *(.con_initcall.init) }
  89. __con_initcall_end = .;
  90. SECURITY_INIT
  91. /* .exit.text is discarded at runtime, not link time, to deal with
  92. references from .rodata */
  93. .exit.text : { *(.exit.text) }
  94. . = ALIGN(_PAGE_SIZE);
  95. __initramfs_start = .;
  96. .init.ramfs : { *(.init.ramfs) }
  97. __initramfs_end = .;
  98. . = ALIGN(32);
  99. __per_cpu_start = .;
  100. .data.percpu : { *(.data.percpu) }
  101. __per_cpu_end = .;
  102. . = ALIGN(_PAGE_SIZE);
  103. __init_end = .;
  104. /* freed after init ends here */
  105. __bss_start = .; /* BSS */
  106. .sbss : {
  107. *(.sbss)
  108. *(.scommon)
  109. }
  110. .bss : {
  111. *(.bss)
  112. *(COMMON)
  113. }
  114. __bss_stop = .;
  115. _end = . ;
  116. /* Sections to be discarded */
  117. /DISCARD/ : {
  118. *(.exit.data)
  119. *(.exitcall.exit)
  120. /* ABI crap starts here */
  121. *(.comment)
  122. *(.MIPS.options)
  123. *(.note)
  124. *(.options)
  125. *(.pdr)
  126. *(.reginfo)
  127. *(.mdebug*)
  128. }
  129. /* This is the MIPS specific mdebug section. */
  130. .mdebug : { *(.mdebug) }
  131. STABS_DEBUG
  132. DWARF_DEBUG
  133. /* These must appear regardless of . */
  134. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  135. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  136. .note : { *(.note) }
  137. }