2 OUTPUT_FORMAT("elf32-ip2k", "elf32-ip2k", "elf32-ip2k")
4 ${RELOCATING+ENTRY(_start)}
7 /* IP2022 default linker script. */
11 D_GPR : org = 0x01000080, len = 128
12 D_RAM : org = 0x01000100, len = 4K - 256
13 P_RAM : org = 0x02000000, len = 16K
14 P_ROM : org = 0x02010000, len = 64K - 32
15 P_RESET : org = 0x0201FFE0, len = 32
16 P_CONFIG : org = 0x02020000, len = 128
21 /* Allocated memory end markers
22 (initialized to start of appropiate memory address). */
23 __data_end = 0x01000100;
24 __pram_end = 0x02000000;
25 __flash_end = 0x02010000;
27 /* Global general purpose registers in direct addressing range. */
33 /* Pre-allocated, pre-initialized data memory. */
34 __data_run_begin = __data_end;
35 __data_load_begin = (__flash_end + 1) & 0xFFFFFFFE;
36 .data __data_run_begin : AT (__data_load_begin)
41 __data_run_end = __data_run_begin + SIZEOF(.data);
42 __data_load_end = __data_load_begin + SIZEOF(.data);
43 __data_end = __data_run_end;
44 __flash_end = __data_load_end;
46 /* Pre-allocated, uninitialized data memory. */
47 __bss_begin = __data_end;
52 __bss_end = __bss_begin + SIZEOF(.bss);
53 __data_end = __bss_end;
55 /* Pre-allocated PRAM data memory. */
56 __pram_data_begin = (__pram_end + 1) & 0xFFFFFFFE;
57 .pram_data __pram_data_begin :
61 __pram_data_end = __pram_data_begin + SIZEOF(.pram_data);
62 __pram_end = __pram_data_end;
65 __pram_run_begin = (__pram_end + 1) & 0xFFFFFFFE;
66 __pram_load_begin = (__flash_end + 1) & 0xFFFFFFFE;
67 .pram __pram_run_begin : AT (__pram_load_begin)
71 __pram_run_end = __pram_run_begin + SIZEOF(.pram);
72 __pram_load_end = __pram_load_begin + SIZEOF(.pram);
74 __pram_load_shift = ((__pram_run_begin - __pram_load_begin) & 0x1FFFF) | 0x02000000;
75 __pram_end = __pram_run_end;
76 __flash_end = __pram_load_end;
78 /* PRAM overlay code. */
79 __pram_overlay_run_start = (__pram_end + 1) & 0xFFFFFFFE;
80 __pram_overlay_load_start = (__flash_end + 1) & 0xFFFFFFFE;
81 OVERLAY __pram_overlay_run_start : AT (__pram_overlay_load_start)
83 .pram1 { */overlay1/* (.pram); * (.pram1) }
84 .pram2 { */overlay2/* (.pram); * (.pram2) }
86 __pram_overlay_run_end = .;
87 __pram_overlay_load_end = __pram_overlay_load_start + SIZEOF(.pram1) + SIZEOF(.pram2);
88 __pram_end = __pram_overlay_run_end;
89 __flash_end = __pram_overlay_load_end;
92 __text_begin = (__flash_end + 1) & 0xFFFFFFFE;
98 __text_end = __text_begin + SIZEOF(.text);
99 __flash_end = __text_end;
102 __strings_begin = (__flash_end + 1) & 0xFFFFFFFE;
103 .strings __strings_begin :
108 __strings_end = __strings_begin + SIZEOF (.strings);
109 __flash_end = __strings_end;
111 .ctors : { * (.ctors) } > P_ROM
112 .dtors : { * (.dtors) } > P_ROM
115 .reset : { * (.reset) } >P_RESET = 0xffff
117 /* Configuration block. */
118 .config : { * (.config) } >P_CONFIG = 0xffff
121 PROVIDE (__stack = 0x01000FFF);
123 /* Stabs debugging sections. */
124 .stab 0 : { *(.stab) }
125 .stabstr 0 : { *(.stabstr) }
126 .stab.excl 0 : { *(.stab.excl) }
127 .stab.exclstr 0 : { *(.stab.exclstr) }
128 .stab.index 0 : { *(.stab.index) }
129 .stab.indexstr 0 : { *(.stab.indexstr) }
130 .comment 0 : { *(.comment) }
133 .debug 0 : { *(.debug) }
134 .line 0 : { *(.line) }
135 /* GNU DWARF 1 extensions. */
136 .debug_srcinfo 0 : { *(.debug_srcinfo .zdebug_srcinfo) }
137 .debug_sfnames 0 : { *(.debug_sfnames .zdebug_sfnames) }
138 /* DWARF 1.1 and DWARF 2. */
139 .debug_aranges 0 : { *(.debug_aranges .zdebug_aranges) }
140 .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
142 .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*} .zdebug_info) }
143 .debug_abbrev 0 : { *(.debug_abbrev .zdebug_abbrev) }
144 .debug_line 0 : { *(.debug_line .zdebug_line) }
145 .debug_frame 0 : { *(.debug_frame .zdebug_frame) }
146 .debug_str 0 : { *(.debug_str .zdebug_str) }
147 .debug_loc 0 : { *(.debug_loc .zdebug_loc) }
148 .debug_macinfo 0 : { *(.debug_macinfo .zdebug_macinfo) }