vmlinux.lds.S 2.7 KB

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