1 /* Linker script for running ELF programs in the Sparc simulator */
3 /* OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparcle") */
4 /* OUTPUT_FORMAT("elf32-sparc") */
9 GROUP(-lc -lerc32 -lgcc) /* -lerc32 used to be -lsim */
12 /* Do we need any of these for elf?
16 * The memory map looks like this:
17 * +--------------------+ <- low memory
21 * | ctor list | the ctor and dtor lists are for
22 * | dtor list | C++ support
24 * +--------------------+
25 * | .data | initialized data goes here
28 * +--------------------+
30 * | __bss_start | start of bss, cleared by crt0
31 * | _end | start of heap, used by sbrk()
32 * +--------------------+
36 * | __stack | top of stack
37 * +--------------------+ <- high memory
41 * User modifiable values:
43 * _CLOCK_SPEED in Mhz (used to program the counter/timers)
45 * _PROM_SIZE size of PROM (permissible values are 4K, 8K, 16K
46 * 32K, 64K, 128K, 256K, and 512K)
47 * _RAM_SIZE size of RAM (permissible values are 256K, 512K,
48 * 1MB, 2Mb, 4Mb, 8Mb, 16Mb, and 32Mb)
50 * These symbols are only used in assembler code, so they only need to
51 * be listed once. They should always be refered to without SYM().
59 _RAM_START = 0x02000000;
60 _RAM_END = _RAM_START + _RAM_SIZE;
61 _STACK_SIZE = (16 * 1024);
62 _PROM_START = 0x00000000;
63 _PROM_END = _PROM_START + _PROM_SIZE;
67 * Base address of the on-CPU peripherals
70 _ERC32_MEC = 0x01f80000;
73 * Setup the memory map for the SIS simulator.
74 * stack grows up towards low memory.
79 rom : ORIGIN = 0x00000000, LENGTH = 4M
80 ram (rwx) : ORIGIN = 0x02000000, LENGTH = 2M
83 __stack = _RAM_START + _RAM_SIZE - 4 * 16;
84 __trap_stack = (_RAM_START + _RAM_SIZE - 4 * 16) - _STACK_SIZE;
87 * All the symbols that might be accessed from C code need to be
88 * listed twice, once with an additional underscore. aout format needs
89 * and extra underscore, whereas coff & elf doesn't. This is to work
108 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
109 KEEP (*(SORT(.ctors.*)))
110 KEEP (*crtend.o(.ctors))
115 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
116 KEEP (*(SORT(.dtors.*)))
117 KEEP (*crtend.o(.dtors))
125 __EH_FRAME_BEGIN__ = .;
133 PROVIDE(endtext = .);
136 .shbss SIZEOF(.text) + ADDR(.text) :
154 .bss SIZEOF(.data) + ADDR(.data) :
158 __bss_start = ALIGN(0x8);
165 PROVIDE (end = ALIGN(0x8));
168 /* Stabs debugging sections. */
169 .stab 0 : { *(.stab) }
170 .stabstr 0 : { *(.stabstr) }
171 .stab.excl 0 : { *(.stab.excl) }
172 .stab.exclstr 0 : { *(.stab.exclstr) }
173 .stab.index 0 : { *(.stab.index) }
174 .stab.indexstr 0 : { *(.stab.indexstr) }
175 .comment 0 : { *(.comment) }
176 /* DWARF debug sections.
177 Symbols in the DWARF debugging sections are relative to the beginning
178 of the section so we begin them at 0. */
180 .debug 0 : { *(.debug) }
181 .line 0 : { *(.line) }
182 /* GNU DWARF 1 extensions */
183 .debug_srcinfo 0 : { *(.debug_srcinfo) }
184 .debug_sfnames 0 : { *(.debug_sfnames) }
185 /* DWARF 1.1 and DWARF 2 */
186 .debug_aranges 0 : { *(.debug_aranges) }
187 .debug_pubnames 0 : { *(.debug_pubnames) }
189 .debug_info 0 : { *(.debug_info) }
190 .debug_abbrev 0 : { *(.debug_abbrev) }
191 .debug_line 0 : { *(.debug_line) }
192 .debug_frame 0 : { *(.debug_frame) }
193 .debug_str 0 : { *(.debug_str) }
194 .debug_loc 0 : { *(.debug_loc) }
195 .debug_macinfo 0 : { *(.debug_macinfo) }
196 .debug_ranges 0 : { *(.debug_ranges) }
197 /* SGI/MIPS DWARF 2 extensions */
198 .debug_weaknames 0 : { *(.debug_weaknames) }
199 .debug_funcnames 0 : { *(.debug_funcnames) }
200 .debug_typenames 0 : { *(.debug_typenames) }
201 .debug_varnames 0 : { *(.debug_varnames) }
202 /* These must appear regardless of . */