ldscript.ld 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. OUTPUT_FORMAT(elf32-i386)
  2. OUTPUT_ARCH(i386:i386)
  3. MEMORY
  4. {
  5. WHOLE : org = 0x00000000, l = 4M
  6. }
  7. SECTIONS
  8. {
  9. .text.bootsect : AT(0x00)
  10. {
  11. *(.text.bootsect)
  12. } > WHOLE
  13. .magicnumber : AT(0x1fe)
  14. {
  15. BYTE(0x55);
  16. BYTE(0xaa);
  17. } > WHOLE
  18. .text 0x600 : AT(0x200)
  19. {
  20. *(.text.loader)
  21. *(.text*)
  22. *(.rodata*)
  23. } > WHOLE
  24. .data :
  25. {
  26. start_ctors = .;
  27. KEEP(*(.init_array));
  28. KEEP(*(SORT_BY_INIT_PRIORITY(.init_array*)));
  29. end_ctors = .;
  30. *(.data)
  31. *(.data*)
  32. } > WHOLE
  33. .bss :
  34. {
  35. *(.bss)
  36. *(.bss*)
  37. } > WHOLE
  38. /* Stabs debugging sections. */
  39. .stab 0 : { *(.stab) }
  40. .stabstr 0 : { *(.stabstr) }
  41. .stab.excl 0 : { *(.stab.excl) }
  42. .stab.exclstr 0 : { *(.stab.exclstr) }
  43. .stab.index 0 : { *(.stab.index) }
  44. .stab.indexstr 0 : { *(.stab.indexstr) }
  45. .comment 0 : { *(.comment) }
  46. /* DWARF debug sections.
  47. Symbols in the DWARF debugging sections are relative to the beginning
  48. of the section so we begin them at 0. */
  49. /* DWARF 1 */
  50. .debug 0 : { *(.debug) }
  51. .line 0 : { *(.line) }
  52. /* GNU DWARF 1 extensions */
  53. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  54. .debug_sfnames 0 : { *(.debug_sfnames) }
  55. /* DWARF 1.1 and DWARF 2 */
  56. .debug_aranges 0 : { *(.debug_aranges) }
  57. .debug_pubnames 0 : { *(.debug_pubnames) }
  58. /* DWARF 2 */
  59. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  60. .debug_abbrev 0 : { *(.debug_abbrev) }
  61. .debug_line 0 : { *(.debug_line) }
  62. .debug_frame 0 : { *(.debug_frame) }
  63. .debug_str 0 : { *(.debug_str) }
  64. .debug_loc 0 : { *(.debug_loc) }
  65. .debug_macinfo 0 : { *(.debug_macinfo) }
  66. /* SGI/MIPS DWARF 2 extensions */
  67. .debug_weaknames 0 : { *(.debug_weaknames) }
  68. .debug_funcnames 0 : { *(.debug_funcnames) }
  69. .debug_typenames 0 : { *(.debug_typenames) }
  70. .debug_varnames 0 : { *(.debug_varnames) }
  71. .end : AT(0x0ffffff)
  72. {
  73. BYTE(0x00);
  74. } > WHOLE
  75. /DISCARD/ :
  76. {
  77. *(.comment)
  78. }
  79. }