ldscript.ld 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. *(.data)
  27. *(.data*)
  28. } > WHOLE
  29. .bss :
  30. {
  31. *(.bss)
  32. *(.bss*)
  33. } > WHOLE
  34. /* Stabs debugging sections. */
  35. .stab 0 : { *(.stab) }
  36. .stabstr 0 : { *(.stabstr) }
  37. .stab.excl 0 : { *(.stab.excl) }
  38. .stab.exclstr 0 : { *(.stab.exclstr) }
  39. .stab.index 0 : { *(.stab.index) }
  40. .stab.indexstr 0 : { *(.stab.indexstr) }
  41. .comment 0 : { *(.comment) }
  42. /* DWARF debug sections.
  43. Symbols in the DWARF debugging sections are relative to the beginning
  44. of the section so we begin them at 0. */
  45. /* DWARF 1 */
  46. .debug 0 : { *(.debug) }
  47. .line 0 : { *(.line) }
  48. /* GNU DWARF 1 extensions */
  49. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  50. .debug_sfnames 0 : { *(.debug_sfnames) }
  51. /* DWARF 1.1 and DWARF 2 */
  52. .debug_aranges 0 : { *(.debug_aranges) }
  53. .debug_pubnames 0 : { *(.debug_pubnames) }
  54. /* DWARF 2 */
  55. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  56. .debug_abbrev 0 : { *(.debug_abbrev) }
  57. .debug_line 0 : { *(.debug_line) }
  58. .debug_frame 0 : { *(.debug_frame) }
  59. .debug_str 0 : { *(.debug_str) }
  60. .debug_loc 0 : { *(.debug_loc) }
  61. .debug_macinfo 0 : { *(.debug_macinfo) }
  62. /* SGI/MIPS DWARF 2 extensions */
  63. .debug_weaknames 0 : { *(.debug_weaknames) }
  64. .debug_funcnames 0 : { *(.debug_funcnames) }
  65. .debug_typenames 0 : { *(.debug_typenames) }
  66. .debug_varnames 0 : { *(.debug_varnames) }
  67. .end : AT(0x0ffffff)
  68. {
  69. BYTE(0x00);
  70. } > WHOLE
  71. /DISCARD/ :
  72. {
  73. *(.comment)
  74. }
  75. }