vmlinux.lds.S 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. /*
  45. * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
  46. * limits the maximum alignment to at most 32kB and results in the following
  47. * warning:
  48. *
  49. * CC arch/mips/kernel/init_task.o
  50. * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
  51. * is greater than maximum object file alignment. Using 32768
  52. */
  53. . = ALIGN(_PAGE_SIZE);
  54. *(.data.init_task)
  55. *(.data)
  56. CONSTRUCTORS
  57. }
  58. _gp = . + 0x8000;
  59. .lit8 : { *(.lit8) }
  60. .lit4 : { *(.lit4) }
  61. /* We want the small data sections together, so single-instruction offsets
  62. can access them all, and initialized data all before uninitialized, so
  63. we can shorten the on-disk segment size. */
  64. .sdata : { *(.sdata) }
  65. . = ALIGN(_PAGE_SIZE);
  66. __nosave_begin = .;
  67. .data_nosave : { *(.data.nosave) }
  68. . = ALIGN(_PAGE_SIZE);
  69. __nosave_end = .;
  70. . = ALIGN(32);
  71. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  72. _edata = .; /* End of data section */
  73. /* will be freed after init */
  74. . = ALIGN(_PAGE_SIZE); /* Init code and data */
  75. __init_begin = .;
  76. .init.text : {
  77. _sinittext = .;
  78. *(.init.text)
  79. _einittext = .;
  80. }
  81. .init.data : { *(.init.data) }
  82. . = ALIGN(16);
  83. __setup_start = .;
  84. .init.setup : { *(.init.setup) }
  85. __setup_end = .;
  86. __initcall_start = .;
  87. .initcall.init : {
  88. INITCALLS
  89. }
  90. __initcall_end = .;
  91. __con_initcall_start = .;
  92. .con_initcall.init : { *(.con_initcall.init) }
  93. __con_initcall_end = .;
  94. SECURITY_INIT
  95. /* .exit.text is discarded at runtime, not link time, to deal with
  96. references from .rodata */
  97. .exit.text : { *(.exit.text) }
  98. .exit.data : { *(.exit.data) }
  99. . = ALIGN(_PAGE_SIZE);
  100. __initramfs_start = .;
  101. .init.ramfs : { *(.init.ramfs) }
  102. __initramfs_end = .;
  103. . = ALIGN(32);
  104. __per_cpu_start = .;
  105. .data.percpu : { *(.data.percpu) }
  106. __per_cpu_end = .;
  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. *(.comment)
  126. *(.MIPS.options)
  127. *(.note)
  128. *(.options)
  129. *(.pdr)
  130. *(.reginfo)
  131. *(.mdebug*)
  132. }
  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. }