1/*
2 * This is the "template" linker script.  It gets run through the C preprocessor
3 * (via cpp) to construct the real linker script.
4 */
5
6/* our toolchain defines 'mips'.  Undefine it so it doesn't get expanded */
7
8#undef mips
9
10#ifndef ZIPSTART_TEXT_START
11#define ZIPSTART_TEXT_START 0x9fc00000
12#endif
13#ifndef ZIPSTART_ROM_START
14#define ZIPSTART_ROM_START  0xbfc00000
15#endif
16#ifndef ZIPSTART_DATA_START
17#define ZIPSTART_DATA_START 0x80080000		/* 512 KB */
18#endif
19
20OUTPUT_ARCH(mips)
21ENTRY(vec_reset)
22
23SECTIONS
24{
25  . = ZIPSTART_TEXT_START;
26  .text : 
27
28   AT ( ZIPSTART_ROM_START )
29   {
30     _ftext = . ;
31    *(.init)
32     eprol  =  .;
33    *(.text)
34
35    *(.fini)
36    *(.rodata)
37    *(.cfebin)
38     _etext  =  .;
39
40   }
41
42/*
43 * If ROM, locate a copy of the data segment in the ROM area.  Otherwise,
44 * we are loading like a regular application so take data segment from
45 * current value of "dot".
46 */
47  .data ZIPSTART_DATA_START :
48    AT ( (LOADADDR(.text) + SIZEOF ( .text ) + 15) & 0xFFFFFFF0)
49  {
50    _gp = ALIGN(16) + 0x7FF0; 
51    _fdata = .;
52    *(.rdata)
53    *(.data)
54    CONSTRUCTORS
55    *(.sdata)
56  }
57   . = ALIGN(16);
58   _edata  =  .;
59   _fbss = .;
60  .sbss : {
61    *(.sbss)
62    *(.scommon)
63  }
64  .bss : {
65    *(.bss)
66    *(COMMON)
67  }
68  . = ALIGN(16);
69   _end = .;
70   _elf_start = LOADADDR(.data) + SIZEOF(.data);
71
72
73}
74
75