v850.sc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # Copyright (C) 2014-2022 Free Software Foundation, Inc.
  2. #
  3. # Copying and distribution of this file, with or without modification,
  4. # are permitted in any medium without royalty provided the copyright
  5. # notice and this notice are preserved.
  6. cat << EOF
  7. /* Copyright (C) 2014-2022 Free Software Foundation, Inc.
  8. Copying and distribution of this script, with or without modification,
  9. are permitted in any medium without royalty provided the copyright
  10. notice and this notice are preserved. */
  11. OUTPUT_FORMAT("elf32-v850", "elf32-v850",
  12. "elf32-v850")
  13. OUTPUT_ARCH(v850:old-gcc-abi)
  14. ${RELOCATING+ENTRY(_start)}
  15. SEARCH_DIR(.);
  16. ${RELOCATING+EXTERN(__ctbp __ep __gp)};
  17. SECTIONS
  18. {
  19. /* This saves a little space in the ELF file, since the zda starts
  20. at a higher location that the ELF headers take up. */
  21. .zdata ${ZDATA_START_ADDR} :
  22. {
  23. *(.zdata)
  24. ${RELOCATING+*(.zbss)
  25. *(reszdata)
  26. *(.zcommon)}
  27. }
  28. /* This is the read only part of the zero data area.
  29. Having it as a separate section prevents its
  30. attributes from being inherited by the zdata
  31. section. Specifically it prevents the zdata
  32. section from being marked READONLY. */
  33. .rozdata ${ROZDATA_START_ADDR} :
  34. {
  35. *(.rozdata)
  36. ${RELOCATING+*(romzdata)
  37. *(romzbss)}
  38. }
  39. /* Read-only sections, merged into text segment. */
  40. . = ${TEXT_START_ADDR};
  41. .interp : { *(.interp) }
  42. .hash : { *(.hash) }
  43. .dynsym : { *(.dynsym) }
  44. .dynstr : { *(.dynstr) }
  45. .rel.text : { *(.rel.text) }
  46. .rela.text : { *(.rela.text) }
  47. .rel.data : { *(.rel.data) }
  48. .rela.data : { *(.rela.data) }
  49. .rel.rodata : { *(.rel.rodata) }
  50. .rela.rodata : { *(.rela.rodata) }
  51. .rel.gcc_except_table : { *(.rel.gcc_except_table) }
  52. .rela.gcc_except_table : { *(.rela.gcc_except_table) }
  53. .rel.got : { *(.rel.got) }
  54. .rela.got : { *(.rela.got) }
  55. .rel.ctors : { *(.rel.ctors) }
  56. .rela.ctors : { *(.rela.ctors) }
  57. .rel.dtors : { *(.rel.dtors) }
  58. .rela.dtors : { *(.rela.dtors) }
  59. .rel.init : { *(.rel.init) }
  60. .rela.init : { *(.rela.init) }
  61. .rel.fini : { *(.rel.fini) }
  62. .rela.fini : { *(.rela.fini) }
  63. .rel.bss : { *(.rel.bss) }
  64. .rela.bss : { *(.rela.bss) }
  65. .rel.plt : { *(.rel.plt) }
  66. .rela.plt : { *(.rela.plt) }
  67. .init : { KEEP (*(SORT_NONE(.init))) } =0
  68. .plt : { *(.plt) }
  69. .text :
  70. {
  71. *(.text)
  72. ${RELOCATING+*(.text.*)}
  73. /* .gnu.warning sections are handled specially by elf.em. */
  74. *(.gnu.warning)
  75. ${RELOCATING+*(.gnu.linkonce.t*)}
  76. } =0
  77. ${RELOCATING+_etext = .;}
  78. ${RELOCATING+PROVIDE (etext = .);}
  79. /* This is special code area at the end of the normal text section.
  80. It contains a small lookup table at the start followed by the
  81. code pointed to by entries in the lookup table. */
  82. .call_table_data ${CALL_TABLE_START_ADDR} :
  83. {
  84. ${RELOCATING+PROVIDE(__ctbp = .);}
  85. *(.call_table_data)
  86. } = 0xff /* Fill gaps with 0xff. */
  87. .call_table_text :
  88. {
  89. *(.call_table_text)
  90. }
  91. .fini : { KEEP (*(SORT_NONE(.fini))) } =0
  92. .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*) *(.gnu.linkonce.r*)} }
  93. .rodata1 : { *(.rodata1) }
  94. .data :
  95. {
  96. *(.data)
  97. ${RELOCATING+*(.data.*)
  98. *(.gnu.linkonce.d*)}
  99. ${CONSTRUCTING+CONSTRUCTORS}
  100. }
  101. .data1 : { *(.data1) }
  102. .ctors :
  103. {
  104. ${CONSTRUCTING+___ctors = .;}
  105. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  106. ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
  107. KEEP (*crtend(.ctors))
  108. ${CONSTRUCTING+___ctors_end = .;}
  109. }
  110. .dtors :
  111. {
  112. ${CONSTRUCTING+___dtors = .;}
  113. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  114. ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
  115. KEEP (*crtend.o(.dtors))
  116. ${CONSTRUCTING+___dtors_end = .;}
  117. }
  118. .jcr :
  119. {
  120. KEEP (*(.jcr))
  121. }
  122. .gcc_except_table : { *(.gcc_except_table) }
  123. .got : {${RELOCATING+ *(.got.plt)} *(.got) }
  124. .dynamic : { *(.dynamic) }
  125. .tdata ${TDATA_START_ADDR} :
  126. {
  127. ${RELOCATING+PROVIDE (__ep = .);
  128. *(.tbyte)
  129. *(.tcommon_byte)}
  130. *(.tdata)
  131. ${RELOCATING+*(.tbss)
  132. *(.tcommon)}
  133. }
  134. /* We want the small data sections together, so single-instruction offsets
  135. can access them all, and initialized data all before uninitialized, so
  136. we can shorten the on-disk segment size. */
  137. .sdata ${SDATA_START_ADDR} :
  138. {
  139. ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
  140. *(.sdata)
  141. }
  142. /* See comment about .rozdata. */
  143. .rosdata ${ROSDATA_START_ADDR} :
  144. {
  145. *(.rosdata)
  146. }
  147. /* We place the .sbss data section AFTER the .rosdata section, so that
  148. it can directly precede the .bss section. This allows runtime startup
  149. code to initialise all the zero-data sections by simply taking the
  150. value of '_edata' and zeroing until it reaches '_end'. */
  151. .sbss :
  152. {
  153. ${RELOCATING+__sbss_start = .;}
  154. *(.sbss)
  155. ${RELOCATING+*(.scommon)}
  156. }
  157. ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
  158. ${RELOCATING+PROVIDE (edata = _edata);}
  159. .bss :
  160. {
  161. ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
  162. ${RELOCATING+__real_bss_start = . ;}
  163. ${RELOCATING+*(.dynbss)}
  164. *(.bss)
  165. ${RELOCATING+*(COMMON)}
  166. }
  167. ${RELOCATING+_end = . ;}
  168. ${RELOCATING+PROVIDE (end = .);}
  169. ${RELOCATING+PROVIDE (_heap_start = .);}
  170. .note.renesas 0 : { KEEP(*(.note.renesas)) }
  171. /* Stabs debugging sections. */
  172. .stab 0 : { *(.stab) }
  173. .stabstr 0 : { *(.stabstr) }
  174. .stab.excl 0 : { *(.stab.excl) }
  175. .stab.exclstr 0 : { *(.stab.exclstr) }
  176. .stab.index 0 : { *(.stab.index) }
  177. .stab.indexstr 0 : { *(.stab.indexstr) }
  178. .comment 0 : { *(.comment) }
  179. EOF
  180. . $srcdir/scripttempl/DWARF.sc
  181. cat <<EOF
  182. /* User stack. */
  183. .stack 0x200000 :
  184. {
  185. ${RELOCATING+__stack = .;}
  186. *(.stack)
  187. }
  188. }
  189. EOF