vmlinux.lds.S 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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_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. NOTES
  41. RODATA
  42. /* writeable */
  43. .data : { /* Data */
  44. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  45. /*
  46. * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
  47. * limits the maximum alignment to at most 32kB and results in the following
  48. * warning:
  49. *
  50. * CC arch/mips/kernel/init_task.o
  51. * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
  52. * is greater than maximum object file alignment. Using 32768
  53. */
  54. . = ALIGN(_PAGE_SIZE);
  55. *(.data.init_task)
  56. DATA_DATA
  57. CONSTRUCTORS
  58. }
  59. _gp = . + 0x8000;
  60. .lit8 : { *(.lit8) }
  61. .lit4 : { *(.lit4) }
  62. /* We want the small data sections together, so single-instruction offsets
  63. can access them all, and initialized data all before uninitialized, so
  64. we can shorten the on-disk segment size. */
  65. .sdata : { *(.sdata) }
  66. . = ALIGN(_PAGE_SIZE);
  67. __nosave_begin = .;
  68. .data_nosave : { *(.data.nosave) }
  69. . = ALIGN(_PAGE_SIZE);
  70. __nosave_end = .;
  71. . = ALIGN(32);
  72. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  73. _edata = .; /* End of data section */
  74. /* will be freed after init */
  75. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  76. __init_begin = .;
  77. .init.text : {
  78. _sinittext = .;
  79. *(.init.text)
  80. _einittext = .;
  81. }
  82. .init.data : { *(.init.data) }
  83. . = ALIGN(16);
  84. __setup_start = .;
  85. .init.setup : { *(.init.setup) }
  86. __setup_end = .;
  87. __initcall_start = .;
  88. .initcall.init : {
  89. INITCALLS
  90. }
  91. __initcall_end = .;
  92. __con_initcall_start = .;
  93. .con_initcall.init : { *(.con_initcall.init) }
  94. __con_initcall_end = .;
  95. SECURITY_INIT
  96. /* .exit.text is discarded at runtime, not link time, to deal with
  97. references from .rodata */
  98. .exit.text : { *(.exit.text) }
  99. .exit.data : { *(.exit.data) }
  100. #if defined(CONFIG_BLK_DEV_INITRD)
  101. . = ALIGN(_PAGE_SIZE);
  102. __initramfs_start = .;
  103. .init.ramfs : { *(.init.ramfs) }
  104. __initramfs_end = .;
  105. #endif
  106. PERCPU(_PAGE_SIZE)
  107. . = ALIGN(_PAGE_SIZE);
  108. __init_end = .;
  109. /* freed after init ends here */
  110. __bss_start = .; /* BSS */
  111. .sbss : {
  112. *(.sbss)
  113. *(.scommon)
  114. }
  115. .bss : {
  116. *(.bss)
  117. *(COMMON)
  118. }
  119. __bss_stop = .;
  120. _end = . ;
  121. /* Sections to be discarded */
  122. /DISCARD/ : {
  123. *(.exitcall.exit)
  124. /* ABI crap starts here */
  125. *(.MIPS.options)
  126. *(.options)
  127. *(.pdr)
  128. *(.reginfo)
  129. }
  130. /* These mark the ABI of the kernel for debuggers. */
  131. .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
  132. .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
  133. /* This is the MIPS specific mdebug section. */
  134. .mdebug : { *(.mdebug) }
  135. STABS_DEBUG
  136. DWARF_DEBUG
  137. /* These must appear regardless of . */
  138. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  139. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  140. .note : { *(.note) }
  141. }