vmlinux.lds.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. #include <asm/asm-offsets.h>
  2. #include <asm/thread_info.h>
  3. #define PAGE_SIZE _PAGE_SIZE
  4. /*
  5. * Put .bss..swapper_pg_dir as the first thing in .bss. This will
  6. * ensure that it has .bss alignment (64K).
  7. */
  8. #define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
  9. #include <asm-generic/vmlinux.lds.h>
  10. #undef mips
  11. #define mips mips
  12. OUTPUT_ARCH(mips)
  13. ENTRY(kernel_entry)
  14. PHDRS {
  15. text PT_LOAD FLAGS(7); /* RWX */
  16. #ifndef CONFIG_CAVIUM_OCTEON_SOC
  17. note PT_NOTE FLAGS(4); /* R__ */
  18. #endif /* CAVIUM_OCTEON_SOC */
  19. }
  20. #ifdef CONFIG_32BIT
  21. #ifdef CONFIG_CPU_LITTLE_ENDIAN
  22. jiffies = jiffies_64;
  23. #else
  24. jiffies = jiffies_64 + 4;
  25. #endif
  26. #else
  27. jiffies = jiffies_64;
  28. #endif
  29. SECTIONS
  30. {
  31. #ifdef CONFIG_BOOT_ELF64
  32. /* Read-only sections, merged into text segment: */
  33. /* . = 0xc000000000000000; */
  34. /* This is the value for an Origin kernel, taken from an IRIX kernel. */
  35. /* . = 0xc00000000001c000; */
  36. /* Set the vaddr for the text segment to a value
  37. * >= 0xa800 0000 0001 9000 if no symmon is going to configured
  38. * >= 0xa800 0000 0030 0000 otherwise
  39. */
  40. /* . = 0xa800000000300000; */
  41. . = 0xffffffff80300000;
  42. #endif
  43. . = VMLINUX_LOAD_ADDRESS;
  44. /* read-only */
  45. _text = .; /* Text and read-only data */
  46. .text : {
  47. TEXT_TEXT
  48. SCHED_TEXT
  49. LOCK_TEXT
  50. KPROBES_TEXT
  51. IRQENTRY_TEXT
  52. *(.text.*)
  53. *(.fixup)
  54. *(.gnu.warning)
  55. } :text = 0
  56. _etext = .; /* End of text section */
  57. EXCEPTION_TABLE(16)
  58. /* Exception table for data bus errors */
  59. __dbe_table : {
  60. __start___dbe_table = .;
  61. *(__dbe_table)
  62. __stop___dbe_table = .;
  63. }
  64. #ifdef CONFIG_CAVIUM_OCTEON_SOC
  65. #define NOTES_HEADER
  66. #else /* CONFIG_CAVIUM_OCTEON_SOC */
  67. #define NOTES_HEADER :note
  68. #endif /* CONFIG_CAVIUM_OCTEON_SOC */
  69. NOTES :text NOTES_HEADER
  70. .dummy : { *(.dummy) } :text
  71. _sdata = .; /* Start of data section */
  72. RODATA
  73. /* writeable */
  74. .data : { /* Data */
  75. . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
  76. INIT_TASK_DATA(THREAD_SIZE)
  77. NOSAVE_DATA
  78. CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
  79. READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
  80. DATA_DATA
  81. CONSTRUCTORS
  82. }
  83. _gp = . + 0x8000;
  84. .lit8 : {
  85. *(.lit8)
  86. }
  87. .lit4 : {
  88. *(.lit4)
  89. }
  90. /* We want the small data sections together, so single-instruction offsets
  91. can access them all, and initialized data all before uninitialized, so
  92. we can shorten the on-disk segment size. */
  93. .sdata : {
  94. *(.sdata)
  95. }
  96. _edata = .; /* End of data section */
  97. /* will be freed after init */
  98. . = ALIGN(PAGE_SIZE); /* Init code and data */
  99. __init_begin = .;
  100. INIT_TEXT_SECTION(PAGE_SIZE)
  101. INIT_DATA_SECTION(16)
  102. . = ALIGN(4);
  103. .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
  104. __mips_machines_start = .;
  105. *(.mips.machines.init)
  106. __mips_machines_end = .;
  107. }
  108. /* .exit.text is discarded at runtime, not link time, to deal with
  109. * references from .rodata
  110. */
  111. .exit.text : {
  112. EXIT_TEXT
  113. }
  114. .exit.data : {
  115. EXIT_DATA
  116. }
  117. #ifdef CONFIG_SMP
  118. PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
  119. #endif
  120. #ifdef CONFIG_MIPS_RAW_APPENDED_DTB
  121. __appended_dtb = .;
  122. /* leave space for appended DTB */
  123. . += 0x100000;
  124. #elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
  125. .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
  126. *(.appended_dtb)
  127. KEEP(*(.appended_dtb))
  128. }
  129. #endif
  130. /*
  131. * Align to 64K in attempt to eliminate holes before the
  132. * .bss..swapper_pg_dir section at the start of .bss. This
  133. * also satisfies PAGE_SIZE alignment as the largest page size
  134. * allowed is 64K.
  135. */
  136. . = ALIGN(0x10000);
  137. __init_end = .;
  138. /* freed after init ends here */
  139. /*
  140. * Force .bss to 64K alignment so that .bss..swapper_pg_dir
  141. * gets that alignment. .sbss should be empty, so there will be
  142. * no holes after __init_end. */
  143. BSS_SECTION(0, 0x10000, 8)
  144. _end = . ;
  145. /* These mark the ABI of the kernel for debuggers. */
  146. .mdebug.abi32 : {
  147. KEEP(*(.mdebug.abi32))
  148. }
  149. .mdebug.abi64 : {
  150. KEEP(*(.mdebug.abi64))
  151. }
  152. /* This is the MIPS specific mdebug section. */
  153. .mdebug : {
  154. *(.mdebug)
  155. }
  156. STABS_DEBUG
  157. DWARF_DEBUG
  158. /* These must appear regardless of . */
  159. .gptab.sdata : {
  160. *(.gptab.data)
  161. *(.gptab.sdata)
  162. }
  163. .gptab.sbss : {
  164. *(.gptab.bss)
  165. *(.gptab.sbss)
  166. }
  167. /* Sections to be discarded */
  168. DISCARDS
  169. /DISCARD/ : {
  170. /* ABI crap starts here */
  171. *(.MIPS.abiflags)
  172. *(.MIPS.options)
  173. *(.options)
  174. *(.pdr)
  175. *(.reginfo)
  176. *(.eh_frame)
  177. }
  178. }