vmlinux.lds.S 3.1 KB

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