2
0

z80.ld 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. OUTPUT_FORMAT("elf32-z80", "elf32-z80", "elf32-z80")
  2. OUTPUT_ARCH(z80)
  3. ENTRY(_start)
  4. /*PHDRS
  5. {
  6. text PT_LOAD ;
  7. rodata PT_LOAD ;
  8. data PT_LOAD ;
  9. bss PT_LOAD ;
  10. }*/
  11. SECTIONS
  12. {
  13. /* Main binary */
  14. PROVIDE(_org = .);
  15. . = _org;
  16. PROVIDE(_text = _org);
  17. __text = SEGMENT_START("text", _text);
  18. ".init$absolute" = __text != .;
  19. ".text$absolute" = __text != .;
  20. ".rodata$absolute" = __text != .;
  21. . = __text;
  22. .init : {
  23. __init_start = .;
  24. KEEP(*(SORT_BY_NAME(.init*)))
  25. __init_end = .;
  26. } /*:text*/
  27. .text : {
  28. __text_start = .;
  29. *(.text*)
  30. __text_end = .;
  31. } /*:text*/
  32. .rodata : {
  33. __rodata_start = .;
  34. *(.rodata*)
  35. __rodata_end = .;
  36. } /*:rodata*/
  37. PROVIDE(_data = .);
  38. __data = SEGMENT_START("data", _data);
  39. ".data$absolute" = __data != .;
  40. . = __data;
  41. .data : {
  42. __data_start = .;
  43. *(.data*)
  44. __data_end = .;
  45. } /*:data*/
  46. PROVIDE(_bss = .);
  47. __bss = SEGMENT_START("bss", _bss);
  48. ".bss$absolute" = __bss != .;
  49. . = __bss;
  50. .bss (NOLOAD) : {
  51. __bss_start = .;
  52. *(.bss*)
  53. __bss_end = .;
  54. } /*:bss*/
  55. PROVIDE(_brk = .);
  56. __brk = SEGMENT_START("brk", _brk);
  57. ".brk$absolute" = __brk != .;
  58. . = __brk;
  59. /* .brk is like .bss, except will always be last for grow-up data */
  60. .brk (NOLOAD) : {
  61. __brk_start = .;
  62. *(.brk*)
  63. __brk_end = .;
  64. } /*:bss*/
  65. _end = .; PROVIDE (end = .);
  66. /* Stabs debugging sections. */
  67. .stab 0 : { *(.stab) }
  68. .stabstr 0 : { *(.stabstr) }
  69. .stab.excl 0 : { *(.stab.excl) }
  70. .stab.exclstr 0 : { *(.stab.exclstr) }
  71. .stab.index 0 : { *(.stab.index) }
  72. .stab.indexstr 0 : { *(.stab.indexstr) }
  73. .comment 0 : { *(.comment) }
  74. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  75. /* DWARF debug sections.
  76. Symbols in the DWARF debugging sections are relative to the beginning
  77. of the section so we begin them at 0. */
  78. /* DWARF 1. */
  79. .debug 0 : { *(.debug) }
  80. .line 0 : { *(.line) }
  81. /* GNU DWARF 1 extensions. */
  82. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  83. .debug_sfnames 0 : { *(.debug_sfnames) }
  84. /* DWARF 1.1 and DWARF 2. */
  85. .debug_aranges 0 : { *(.debug_aranges) }
  86. .debug_pubnames 0 : { *(.debug_pubnames) }
  87. /* DWARF 2. */
  88. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  89. .debug_abbrev 0 : { *(.debug_abbrev) }
  90. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  91. .debug_frame 0 : { *(.debug_frame) }
  92. .debug_str 0 : { *(.debug_str) }
  93. .debug_loc 0 : { *(.debug_loc) }
  94. .debug_macinfo 0 : { *(.debug_macinfo) }
  95. /* SGI/MIPS DWARF 2 extensions. */
  96. .debug_weaknames 0 : { *(.debug_weaknames) }
  97. .debug_funcnames 0 : { *(.debug_funcnames) }
  98. .debug_typenames 0 : { *(.debug_typenames) }
  99. .debug_varnames 0 : { *(.debug_varnames) }
  100. /* DWARF 3. */
  101. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  102. .debug_ranges 0 : { *(.debug_ranges) }
  103. /* DWARF 5. */
  104. .debug_addr 0 : { *(.debug_addr) }
  105. .debug_line_str 0 : { *(.debug_line_str) }
  106. .debug_loclists 0 : { *(.debug_loclists) }
  107. .debug_macro 0 : { *(.debug_macro) }
  108. .debug_names 0 : { *(.debug_names) }
  109. .debug_rnglists 0 : { *(.debug_rnglists) }
  110. .debug_str_offsets 0 : { *(.debug_str_offsets) }
  111. .debug_sup 0 : { *(.debug_sup) }
  112. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  113. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  114. }