static_beacon
[aversive.git] / projects / microb2010 / common / avr6.x
1 /* Default linker script, for normal executables */
2 OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
3 OUTPUT_ARCH(avr:6)
4 MEMORY
5 {
6   text      (rx)   : ORIGIN = 0, LENGTH = 1024K
7   data      (rw!x) : ORIGIN = 0x800200, LENGTH = 0xfe00
8   eeprom    (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
9   fuse      (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
10   lock      (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
11   signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
12 }
13 SECTIONS
14 {
15   /* Read-only sections, merged into text segment: */
16   .hash          : { *(.hash)           }
17   .dynsym        : { *(.dynsym)         }
18   .dynstr        : { *(.dynstr)         }
19   .gnu.version   : { *(.gnu.version)    }
20   .gnu.version_d   : { *(.gnu.version_d)        }
21   .gnu.version_r   : { *(.gnu.version_r)        }
22   .rel.init      : { *(.rel.init)               }
23   .rela.init     : { *(.rela.init)      }
24   .rel.text      :
25     {
26       *(.rel.text)
27       *(.rel.text.*)
28       *(.rel.gnu.linkonce.t*)
29     }
30   .rela.text     :
31     {
32       *(.rela.text)
33       *(.rela.text.*)
34       *(.rela.gnu.linkonce.t*)
35     }
36   .rel.fini      : { *(.rel.fini)               }
37   .rela.fini     : { *(.rela.fini)      }
38   .rel.rodata    :
39     {
40       *(.rel.rodata)
41       *(.rel.rodata.*)
42       *(.rel.gnu.linkonce.r*)
43     }
44   .rela.rodata   :
45     {
46       *(.rela.rodata)
47       *(.rela.rodata.*)
48       *(.rela.gnu.linkonce.r*)
49     }
50   .rel.data      :
51     {
52       *(.rel.data)
53       *(.rel.data.*)
54       *(.rel.gnu.linkonce.d*)
55     }
56   .rela.data     :
57     {
58       *(.rela.data)
59       *(.rela.data.*)
60       *(.rela.gnu.linkonce.d*)
61     }
62   .rel.ctors     : { *(.rel.ctors)      }
63   .rela.ctors    : { *(.rela.ctors)     }
64   .rel.dtors     : { *(.rel.dtors)      }
65   .rela.dtors    : { *(.rela.dtors)     }
66   .rel.got       : { *(.rel.got)                }
67   .rela.got      : { *(.rela.got)               }
68   .rel.bss       : { *(.rel.bss)                }
69   .rela.bss      : { *(.rela.bss)               }
70   .rel.plt       : { *(.rel.plt)                }
71   .rela.plt      : { *(.rela.plt)               }
72   /* Internal text space or external memory.  */
73   .text :
74   {
75     *(.vectors)
76     KEEP(*(.vectors))
77     . = 256 + ALIGN(256); /* placeholder for misc microb infos */
78     /* For data that needs to reside in the lower 64k of progmem.  */
79     *(.progmem.gcc*)
80     *(.progmem*)
81     . = ALIGN(2048);
82      __trampolines_start = . ;
83     /* The jump trampolines for the 16-bit limited relocs will reside here.  */
84     *(.trampolines)
85     *(.trampolines*)
86      __trampolines_end = . ;
87     /* For future tablejump instruction arrays for 3 byte pc devices.
88        We don't relax jump/call instructions within these sections.  */
89     *(.jumptables)
90     *(.jumptables*)
91     /* For code that needs to reside in the lower 128k progmem.  */
92     *(.lowtext)
93     *(.lowtext*)
94      __ctors_start = . ;
95      *(.ctors)
96      __ctors_end = . ;
97      __dtors_start = . ;
98      *(.dtors)
99      __dtors_end = . ;
100     KEEP(SORT(*)(.ctors))
101     KEEP(SORT(*)(.dtors))
102     /* From this point on, we don't bother about wether the insns are
103        below or above the 16 bits boundary.  */
104     *(.init0)  /* Start here after reset.  */
105     KEEP (*(.init0))
106     *(.init1)
107     KEEP (*(.init1))
108     *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
109     KEEP (*(.init2))
110     *(.init3)
111     KEEP (*(.init3))
112     *(.init4)  /* Initialize data and BSS.  */
113     KEEP (*(.init4))
114     *(.init5)
115     KEEP (*(.init5))
116     *(.init6)  /* C++ constructors.  */
117     KEEP (*(.init6))
118     *(.init7)
119     KEEP (*(.init7))
120     *(.init8)
121     KEEP (*(.init8))
122     *(.init9)  /* Call main().  */
123     KEEP (*(.init9))
124     *(.text.*) /* trucs de gcc ? */
125     . = ALIGN(2048);
126     uart*(.text)
127     pwm*(.text)
128     parse*(.text)
129     rdline*(.text)
130     vt100*(.text)
131     scheduler*(.text)
132     control_system*(.text)
133     pid*(.text)
134     f08*(.text)
135     f16*(.text)
136     f32*(.text)
137     f64*(.text)
138     vect2*(.text)
139     quadramp*(.text)
140     blocking*(.text)
141     obstacle*(.text)
142     trajectory*(.text)
143     position*(.text)
144     adc*(.text)
145     robot*(.text)
146     error*(.text)
147     encoders*(.text)
148     time*(.text)
149     cirbuf*(.text)
150     i2c*(.text)
151     spi*(.text)
152     ax12*(.text)
153     . = ALIGN(2048);
154     /* some libc stuff */
155     str*(.text)
156     mem*(.text)
157     printf*(.text)
158     vfprintf*(.text)
159     sprintf*(.text)
160     snprintf*(.text)
161     malloc*(.text)
162     free*(.text)
163     fdevopen*(.text)
164     fputc*(.text)
165     . = ALIGN(2048);
166     *(.text)
167     . = ALIGN(2);
168     *(.fini9)  /* _exit() starts here.  */
169     KEEP (*(.fini9))
170     *(.fini8)
171     KEEP (*(.fini8))
172     *(.fini7)
173     KEEP (*(.fini7))
174     *(.fini6)  /* C++ destructors.  */
175     KEEP (*(.fini6))
176     *(.fini5)
177     KEEP (*(.fini5))
178     *(.fini4)
179     KEEP (*(.fini4))
180     *(.fini3)
181     KEEP (*(.fini3))
182     *(.fini2)
183     KEEP (*(.fini2))
184     *(.fini1)
185     KEEP (*(.fini1))
186     *(.fini0)  /* Infinite loop after program termination.  */
187     KEEP (*(.fini0))
188      _etext = . ;
189   }  > text
190   .data   : AT (ADDR (.text) + SIZEOF (.text))
191   {
192      PROVIDE (__data_start = .) ;
193     *(.data)
194     *(.data*)
195     *(.rodata)  /* We need to include .rodata here if gcc is used */
196     *(.rodata*) /* with -fdata-sections.  */
197     *(.gnu.linkonce.d*)
198     . = ALIGN(2);
199      _edata = . ;
200      PROVIDE (__data_end = .) ;
201   }  > data
202   .bss  SIZEOF(.data) + ADDR(.data) :
203   {
204      PROVIDE (__bss_start = .) ;
205     *(.bss)
206     *(.bss*)
207     *(COMMON)
208      PROVIDE (__bss_end = .) ;
209   }  > data
210    __data_load_start = LOADADDR(.data);
211    __data_load_end = __data_load_start + SIZEOF(.data);
212   /* Global data not cleared after reset.  */
213   .noinit  SIZEOF(.bss) + ADDR(.bss) :
214   {
215      PROVIDE (__noinit_start = .) ;
216     *(.noinit*)
217      PROVIDE (__noinit_end = .) ;
218      _end = . ;
219      PROVIDE (__heap_start = .) ;
220   }  > data
221   .eeprom  :
222   {
223     *(.eeprom*)
224      __eeprom_end = . ;
225   }  > eeprom
226   .fuse  :
227   {
228     KEEP(*(.fuse))
229     KEEP(*(.lfuse))
230     KEEP(*(.hfuse))
231     KEEP(*(.efuse))
232   }  > fuse
233   .lock  :
234   {
235     KEEP(*(.lock*))
236   }  > lock
237   .signature  :
238   {
239     KEEP(*(.signature*))
240   }  > signature
241   /* Stabs debugging sections.  */
242   .stab 0 : { *(.stab) }
243   .stabstr 0 : { *(.stabstr) }
244   .stab.excl 0 : { *(.stab.excl) }
245   .stab.exclstr 0 : { *(.stab.exclstr) }
246   .stab.index 0 : { *(.stab.index) }
247   .stab.indexstr 0 : { *(.stab.indexstr) }
248   .comment 0 : { *(.comment) }
249   /* DWARF debug sections.
250      Symbols in the DWARF debugging sections are relative to the beginning
251      of the section so we begin them at 0.  */
252   /* DWARF 1 */
253   .debug          0 : { *(.debug) }
254   .line           0 : { *(.line) }
255   /* GNU DWARF 1 extensions */
256   .debug_srcinfo  0 : { *(.debug_srcinfo) }
257   .debug_sfnames  0 : { *(.debug_sfnames) }
258   /* DWARF 1.1 and DWARF 2 */
259   .debug_aranges  0 : { *(.debug_aranges) }
260   .debug_pubnames 0 : { *(.debug_pubnames) }
261   /* DWARF 2 */
262   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
263   .debug_abbrev   0 : { *(.debug_abbrev) }
264   .debug_line     0 : { *(.debug_line) }
265   .debug_frame    0 : { *(.debug_frame) }
266   .debug_str      0 : { *(.debug_str) }
267   .debug_loc      0 : { *(.debug_loc) }
268   .debug_macinfo  0 : { *(.debug_macinfo) }
269 }