vmlinux.lds.S 2.8 KB

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