[363] | 1 | OUTPUT_FORMAT("elf32-xstormy16", "elf32-xstormy16", "elf32-xstormy16")
|
---|
| 2 | OUTPUT_ARCH(xstormy16)
|
---|
| 3 | ENTRY(_start)
|
---|
| 4 | GROUP( -lc -lgcc -lm -liberty)
|
---|
| 5 |
|
---|
| 6 | INPUT( crti.o )
|
---|
| 7 | INPUT( crtbegin.o )
|
---|
| 8 | INPUT( crtend.o )
|
---|
| 9 | INPUT( crtn.o )
|
---|
| 10 |
|
---|
| 11 | /*************************************/
|
---|
| 12 | /** memory region definition **/
|
---|
| 13 | /*************************************/
|
---|
| 14 | __malloc_start = 0x7800;
|
---|
| 15 | MEMORY
|
---|
| 16 | {
|
---|
| 17 | RAM (w) : ORIGIN = 0x00000, LENGTH = 0x7800
|
---|
| 18 | CHIP (r) : ORIGIN = 0x07f00, LENGTH = 0x100
|
---|
| 19 | ROM (!w) : ORIGIN = 0x08000, LENGTH = 0x78000
|
---|
| 20 | BIOS (!w) : ORIGIN = 0x7FF00+0x100-0x1000, LENGTH = 0x1000
|
---|
| 21 | BIVEC (!w) : ORIGIN = 0x7FF00-0x100, LENGTH = 0x100
|
---|
| 22 | OPTION (r) : ORIGIN = 0x7FF00, LENGTH = 0x100
|
---|
| 23 | }
|
---|
| 24 | /*************************************/
|
---|
| 25 | /** program header definition **/
|
---|
| 26 | /*************************************/
|
---|
| 27 | PHDRS {
|
---|
| 28 | RAM PT_LOAD FLAGS(6) ;
|
---|
| 29 | CHIP PT_LOAD FLAGS(4) ;
|
---|
| 30 | ROM PT_LOAD FLAGS(5) ;
|
---|
| 31 | DROM PT_LOAD FLAGS(6) ;
|
---|
| 32 | CROM PT_LOAD FLAGS(4) ;
|
---|
| 33 | PROM PT_LOAD FLAGS(5) ;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | SECTIONS
|
---|
| 37 | {
|
---|
| 38 | /*************************************/
|
---|
| 39 | /** .bss_below100 section **/
|
---|
| 40 | /*************************************/
|
---|
| 41 | .bss_below100 0x0002 (NOLOAD) : {
|
---|
| 42 | __bss_start = .;
|
---|
| 43 | *(.bss_below100)
|
---|
| 44 | *(.bss_below100.*)
|
---|
| 45 | . = ALIGN(2);
|
---|
| 46 | } > RAM :RAM
|
---|
| 47 | /*************************************/
|
---|
| 48 | /** .data_below100 section **/
|
---|
| 49 | /*************************************/
|
---|
| 50 | .data_below100 : AT ( __rdata ) {
|
---|
| 51 | __data_start = . ;
|
---|
| 52 | *(.data_0)
|
---|
| 53 | *(.data_below100)
|
---|
| 54 | *(.data_below100.*)
|
---|
| 55 | . = ALIGN(2);
|
---|
| 56 | } > RAM :DROM =0
|
---|
| 57 | /*************************************/
|
---|
| 58 | /** .data section **/
|
---|
| 59 | /*************************************/
|
---|
| 60 | .data : AT ( __rdata + SIZEOF(.data_below100) ) {
|
---|
| 61 | *(.data)
|
---|
| 62 | *(.data.*)
|
---|
| 63 | *(.gnu.linkonce.d.*)
|
---|
| 64 | SORT(CONSTRUCTORS)
|
---|
| 65 | . = ALIGN(2);
|
---|
| 66 | __data_end = . ;
|
---|
| 67 | } > RAM :DROM =0
|
---|
| 68 | /*************************************/
|
---|
| 69 | /** .bss section **/
|
---|
| 70 | /*************************************/
|
---|
| 71 | .bss (NOLOAD) : {
|
---|
| 72 | *(.dynbss)
|
---|
| 73 | *(.bss)
|
---|
| 74 | *(.bss.*)
|
---|
| 75 | *(.gnu.linkonce.b.*)
|
---|
| 76 | *(COMMON)
|
---|
| 77 | . = ALIGN(2);
|
---|
| 78 | __bss_end = .;
|
---|
| 79 | } > RAM :RAM
|
---|
| 80 | _end = .;
|
---|
| 81 | /*************************************/
|
---|
| 82 | /** define top of stack **/
|
---|
| 83 | /*************************************/
|
---|
| 84 | __stack = .;
|
---|
| 85 | /*************************************/
|
---|
| 86 | /** sections for target chip info **/
|
---|
| 87 | /*************************************/
|
---|
| 88 | .chip_info : {
|
---|
| 89 | KEEP(*(.chip_info))
|
---|
| 90 | } > CHIP :CHIP =0
|
---|
| 91 | /*************************************/
|
---|
| 92 | /** reset/interrupt vectors at 8000 **/
|
---|
| 93 | /*************************************/
|
---|
| 94 | .int_vec : {
|
---|
| 95 | KEEP(*(.int_vec))
|
---|
| 96 | } > ROM :ROM =0
|
---|
| 97 | /*************************************/
|
---|
| 98 | /** read only section **/
|
---|
| 99 | /*************************************/
|
---|
| 100 | .rodata : {
|
---|
| 101 | *(.rodata)
|
---|
| 102 | *(.rodata.*)
|
---|
| 103 | *(.gnu.linkonce.r.*)
|
---|
| 104 | } > ROM :ROM =0
|
---|
| 105 | /*************************************/
|
---|
| 106 | /** construcrtors/destructors **/
|
---|
| 107 | /*************************************/
|
---|
| 108 | .ctors : {
|
---|
| 109 | KEEP (*crtbegin.o(.ctors))
|
---|
| 110 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
|
---|
| 111 | KEEP (*(SORT(.ctors.*)))
|
---|
| 112 | KEEP (*(.ctors))
|
---|
| 113 | } > ROM :ROM =0
|
---|
| 114 | .dtors : {
|
---|
| 115 | KEEP (*crtbegin.o(.dtors))
|
---|
| 116 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
|
---|
| 117 | KEEP (*(SORT(.dtors.*)))
|
---|
| 118 | KEEP (*(.dtors))
|
---|
| 119 | } > ROM :ROM =0
|
---|
| 120 | /*************************************/
|
---|
| 121 | /** stab for the pointer to function**/
|
---|
| 122 | /*************************************/
|
---|
| 123 | .plt : {
|
---|
| 124 | *(.plt)
|
---|
| 125 | } > ROM :ROM =0
|
---|
| 126 | /*************************************/
|
---|
| 127 | /** other information **/
|
---|
| 128 | /*************************************/
|
---|
| 129 | .jcr : {
|
---|
| 130 | KEEP (*(.jcr))
|
---|
| 131 | } > ROM :ROM =0
|
---|
| 132 | .eh_frame : {
|
---|
| 133 | KEEP (*(.eh_frame))
|
---|
| 134 | } > ROM :ROM =0
|
---|
| 135 | .gcc_except_table : {
|
---|
| 136 | KEEP (*(.gcc_except_table))
|
---|
| 137 | } > ROM :ROM =0
|
---|
| 138 | /*************************************/
|
---|
| 139 | /** .text section **/
|
---|
| 140 | /*************************************/
|
---|
| 141 | .text : {
|
---|
| 142 | *(.text)
|
---|
| 143 | *(.text.*)
|
---|
| 144 | *(.stub)
|
---|
| 145 | *(.gnu.warning)
|
---|
| 146 | *(.gnu.linkonce.t.*)
|
---|
| 147 | } > ROM :ROM =0
|
---|
| 148 | /*************************************/
|
---|
| 149 | /** .init/.fini section **/
|
---|
| 150 | /*************************************/
|
---|
| 151 | .init : {
|
---|
| 152 | KEEP (*crti.o(.init))
|
---|
| 153 | KEEP (*(EXCLUDE_FILE (*crtn.o ) .init))
|
---|
| 154 | KEEP (*(SORT(.init.*)))
|
---|
| 155 | KEEP (*(.init))
|
---|
| 156 | } > ROM :ROM =0
|
---|
| 157 | .fini : {
|
---|
| 158 | KEEP (*crti.o(.fini))
|
---|
| 159 | KEEP (*(EXCLUDE_FILE (*crtn.o ) .fini))
|
---|
| 160 | KEEP (*(SORT(.fini.*)))
|
---|
| 161 | KEEP (*(.fini))
|
---|
| 162 | } > ROM :ROM =0
|
---|
| 163 | /*************************************/
|
---|
| 164 | /** external data **/
|
---|
| 165 | /*************************************/
|
---|
| 166 | .ex_data : {
|
---|
| 167 | *(.ex_data)
|
---|
| 168 | } > ROM :ROM =0
|
---|
| 169 | /*************************************/
|
---|
| 170 | /** initialize value for .data **/
|
---|
| 171 | /*************************************/
|
---|
| 172 | .data_init (NOLOAD) : {
|
---|
| 173 | __rdata = . ;
|
---|
| 174 | . += SIZEOF(.data_below100) ;
|
---|
| 175 | . += SIZEOF(.data) ;
|
---|
| 176 | } > ROM
|
---|
| 177 | /*************************************/
|
---|
| 178 | /** CG-ROM **/
|
---|
| 179 | /*************************************/
|
---|
| 180 | .cg_rom ALIGN(256) : {
|
---|
| 181 | KEEP(*(.cg_rom))
|
---|
| 182 | } > ROM :CROM =0
|
---|
| 183 | /*************************************/
|
---|
| 184 | /** unused ROM area **/
|
---|
| 185 | /*************************************/
|
---|
| 186 | __etext = .;
|
---|
| 187 | __erom = 0x7FF00+0x100-0x1000;
|
---|
| 188 | /*************************************/
|
---|
| 189 | /** .data section for BIOS **/
|
---|
| 190 | /*************************************/
|
---|
| 191 | .bios_data 0 : {
|
---|
| 192 | *(.bios.data)
|
---|
| 193 | *(.bios.data.*)
|
---|
| 194 | }
|
---|
| 195 | /*************************************/
|
---|
| 196 | /** .text section for BIOS **/
|
---|
| 197 | /*************************************/
|
---|
| 198 | .bios_text 0x7FF00+0x100-0x1000 : {
|
---|
| 199 | *(.bios.text)
|
---|
| 200 | *(.bios.text.*)
|
---|
| 201 | } > BIOS :PROM =0
|
---|
| 202 | /*************************************/
|
---|
| 203 | /** .text section for Vector for BIOS*/
|
---|
| 204 | /*************************************/
|
---|
| 205 | .bios_vect 0x7FF00-0x100 : {
|
---|
| 206 | KEEP(*(.bios.vect))
|
---|
| 207 | } > BIVEC :PROM =0
|
---|
| 208 | /*************************************/
|
---|
| 209 | /** sections for user option data **/
|
---|
| 210 | /*************************************/
|
---|
| 211 | .user_option 0x7FF00 : {
|
---|
| 212 | KEEP(*(.user_option))
|
---|
| 213 | } > OPTION :PROM =0
|
---|
| 214 | /*************************************/
|
---|
| 215 | /** Stab debugging sections **/
|
---|
| 216 | /*************************************/
|
---|
| 217 | .stab 0 : { *(.stab) }
|
---|
| 218 | .stabstr 0 : { *(.stabstr) }
|
---|
| 219 | .stab.excl 0 : { *(.stab.excl) }
|
---|
| 220 | .stab.exclstr 0 : { *(.stab.exclstr) }
|
---|
| 221 | .stab.index 0 : { *(.stab.index) }
|
---|
| 222 | .stab.indexstr 0 : { *(.stab.indexstr) }
|
---|
| 223 | .comment 0 : { *(.comment) }
|
---|
| 224 | /*************************************/
|
---|
| 225 | /** DWARF debug sections **/
|
---|
| 226 | /*************************************/
|
---|
| 227 | /* Symbols in the DWARF debugging sections are relative to the beginning
|
---|
| 228 | of the section so we begin them at 0. */
|
---|
| 229 | /* DWARF 1 */
|
---|
| 230 | .debug 0 : { *(.debug) }
|
---|
| 231 | .line 0 : { *(.line) }
|
---|
| 232 | /* GNU DWARF 1 extensions */
|
---|
| 233 | .debug_srcinfo 0 : { *(.debug_srcinfo) }
|
---|
| 234 | .debug_sfnames 0 : { *(.debug_sfnames) }
|
---|
| 235 | /* DWARF 1.1 and DWARF 2 */
|
---|
| 236 | .debug_aranges 0 : { *(.debug_aranges) }
|
---|
| 237 | .debug_pubnames 0 : { *(.debug_pubnames) }
|
---|
| 238 | /* DWARF 2 */
|
---|
| 239 | .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
|
---|
| 240 | .debug_abbrev 0 : { *(.debug_abbrev) }
|
---|
| 241 | .debug_line 0 : { *(.debug_line) }
|
---|
| 242 | .debug_frame 0 : { *(.debug_frame) }
|
---|
| 243 | .debug_str 0 : { *(.debug_str) }
|
---|
| 244 | .debug_loc 0 : { *(.debug_loc) }
|
---|
| 245 | .debug_macinfo 0 : { *(.debug_macinfo) }
|
---|
| 246 | .debug_ranges 0 : { *(.debug_ranges) }
|
---|
| 247 | /* SGI/MIPS DWARF 2 extensions */
|
---|
| 248 | .debug_weaknames 0 : { *(.debug_weaknames) }
|
---|
| 249 | .debug_funcnames 0 : { *(.debug_funcnames) }
|
---|
| 250 | .debug_typenames 0 : { *(.debug_typenames) }
|
---|
| 251 | .debug_varnames 0 : { *(.debug_varnames) }
|
---|
| 252 | }
|
---|