vmlinux.lds.S 3.8 KB

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