ldscript 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * This is a pile of crap that tells the linker how to link the kernel,
  3. * because it's too stupid to be able to work it out on its own.
  4. */
  5. ENTRY(__start)
  6. _DYNAMIC_LINK = 0;
  7. SECTIONS
  8. {
  9. /*
  10. * Base address for the kernel.
  11. */
  12. . = 0x80000200;
  13. /*
  14. * Read-only loaded sections.
  15. */
  16. /* code */
  17. .text : { *(.text) }
  18. /* linker-provided symbol for end of code */
  19. _etext = .;
  20. /* read-only data */
  21. .rodata : { *(.rodata) *(.rodata.*) }
  22. /* MIPS register-usage blather */
  23. .reginfo : { *(.reginfo) }
  24. /*
  25. * Move to a fresh page. This method puts read-only and
  26. * read-write material on separate pages without having to
  27. * waste space on page-alignment in the on-disk file; the
  28. * on-disk page that contains both text and data is mapped
  29. * twice.
  30. *
  31. * For mips kernels we can't write-protect the text anyhow so
  32. * there's no point doing it.
  33. */
  34. /* . = . + 0x1000; */
  35. /*
  36. * Read-write loaded sections.
  37. */
  38. /* initialized data */
  39. .data : {
  40. *(.data)
  41. CONSTRUCTORS
  42. }
  43. /* Value for GP register */
  44. _gp = ALIGN(16) + 0x7ff0;
  45. /* Small data accessed via GP register */
  46. .lit8 : { *(.lit8) }
  47. .lit4 : { *(.lit4) }
  48. .sdata : { *(.sdata) }
  49. /* cleared-to-zero data */
  50. .sbss : { *(.sbss *.scommon) }
  51. .bss : { *(.bss) *(COMMON) }
  52. /* linker-provided symbol for end of program */
  53. _end = .;
  54. /*
  55. * Debug info
  56. */
  57. /* stabs debug sections */
  58. .stab 0: { *(.stab) }
  59. .stabstr 0: { *(.stabstr) }
  60. /* DWARF debug sections */
  61. .debug 0: { *(.debug) }
  62. .line 0: { *(.line) }
  63. .debug_srcinfo 0: { *(.debug_srcinfo) }
  64. .debug_sfnames 0: { *(.debug_sfnames) }
  65. .debug_aranges 0: { *(.debug_aranges) }
  66. .debug_pubnames 0: { *(.debug_pubnames) }
  67. .debug_info 0: { *(.debug_info .gnu.linkonce.wi.*) }
  68. .debug_abbrev 0: { *(.debug_abbrev) }
  69. .debug_line 0: { *(.debug_line) }
  70. .debug_frame 0: { *(.debug_frame) }
  71. .debug_str 0: { *(.debug_str) }
  72. .debug_loc 0: { *(.debug_loc) }
  73. .debug_macinfo 0: { *(.debug_macinfo) }
  74. .debug_weaknames 0: { *(.debug_weaknames) }
  75. .debug_funcnames 0: { *(.debug_funcnames) }
  76. .debug_typenames 0: { *(.debug_typenames) }
  77. .debug_varnames 0: { *(.debug_varnames) }
  78. /* These must appear regardless of . */
  79. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  80. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  81. }