source: rtems/c/src/lib/libbsp/avr/avrtest/startup/linkcmds @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 6.5 KB
Line 
1/*
2 * Declare some sizes.
3 */
4RamBase = DEFINED(RamBase) ? RamBase : 0x08000000;
5RamSize = DEFINED(RamSize) ? RamSize : 64K;
6HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
7StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
8
9/* Default linker script, for normal executables */
10OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
11OUTPUT_ARCH(avr:5)
12MEMORY
13{
14  text   (rx)   : ORIGIN = 0, LENGTH = 256K
15  data   (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
16  eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
17}
18SECTIONS
19{
20  /* Read-only sections, merged into text segment: */
21  .hash          : { *(.hash)           }
22  .dynsym        : { *(.dynsym)         }
23  .dynstr        : { *(.dynstr)         }
24  .gnu.version   : { *(.gnu.version)    }
25  .gnu.version_d   : { *(.gnu.version_d)        }
26  .gnu.version_r   : { *(.gnu.version_r)        }
27  .rel.init      : { *(.rel.init)               }
28  .rela.init     : { *(.rela.init)      }
29  .rel.text      :
30    {
31      *(.rel.text)
32      *(.rel.text.*)
33      *(.rel.gnu.linkonce.t*)
34    }
35  .rela.text     :
36    {
37      *(.rela.text)
38      *(.rela.text.*)
39      *(.rela.gnu.linkonce.t*)
40    }
41  .rel.fini      : { *(.rel.fini)               }
42  .rela.fini     : { *(.rela.fini)      }
43  .rel.rodata    :
44    {
45      *(.rel.rodata)
46      *(.rel.rodata.*)
47      *(.rel.gnu.linkonce.r*)
48    }
49  .rela.rodata   :
50    {
51      *(.rela.rodata)
52      *(.rela.rodata.*)
53      *(.rela.gnu.linkonce.r*)
54    }
55  .rel.data      :
56    {
57      *(.rel.data)
58      *(.rel.data.*)
59      *(.rel.gnu.linkonce.d*)
60    }
61  .rela.data     :
62    {
63      *(.rela.data)
64      *(.rela.data.*)
65      *(.rela.gnu.linkonce.d*)
66    }
67  .rel.ctors     : { *(.rel.ctors)      }
68  .rela.ctors    : { *(.rela.ctors)     }
69  .rel.dtors     : { *(.rel.dtors)      }
70  .rela.dtors    : { *(.rela.dtors)     }
71  .rel.got       : { *(.rel.got)                }
72  .rela.got      : { *(.rela.got)               }
73  .rel.bss       : { *(.rel.bss)                }
74  .rela.bss      : { *(.rela.bss)               }
75  .rel.plt       : { *(.rel.plt)                }
76  .rela.plt      : { *(.rela.plt)               }
77  /* Internal text space or external memory */
78  .text :
79  {
80    *(.vectors)
81    KEEP(*(.vectors))
82    /* For data that needs to reside in the lower 64k of progmem.  */
83    *(.progmem.gcc*)
84    *(.progmem*)
85    . = ALIGN(2);
86     __trampolines_start = . ;
87    /* The jump trampolines for the 16-bit limited relocs will reside here.  */
88    *(.trampolines)
89    *(.trampolines*)
90     __trampolines_end = . ;
91    /* For future tablejump instruction arrays for 3 byte pc devices.
92       We don't relax jump/call instructions within these sections.  */
93    *(.jumptables)
94    *(.jumptables*)
95    /* For code that needs to reside in the lower 128k progmem.  */
96    *(.lowtext)
97    *(.lowtext*)
98     __ctors_start = . ;
99     *(.ctors)
100     __ctors_end = . ;
101     __dtors_start = . ;
102     *(.dtors)
103     __dtors_end = . ;
104    KEEP(SORT(*)(.ctors))
105    KEEP(SORT(*)(.dtors))
106    /* From this point on, we don't bother about wether the insns are
107       below or above the 16 bits boundary.  */
108    *(.init0)  /* Start here after reset.  */
109    KEEP (*(.init0))
110    *(.init1)
111    KEEP (*(.init1))
112    *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
113    KEEP (*(.init2))
114    *(.init3)
115    KEEP (*(.init3))
116    *(.init4)  /* Initialize data and BSS.  */
117    KEEP (*(.init4))
118    *(.init5)
119    KEEP (*(.init5))
120    *(.init6)  /* C++ constructors.  */
121    KEEP (*(.init6))
122    *(.init7)
123    KEEP (*(.init7))
124    *(.init8)
125    KEEP (*(.init8))
126    *(.init9)  /* Call main().  */
127    KEEP (*(.init9))
128    *(.text)
129    . = ALIGN(2);
130    *(.text.*)
131    . = ALIGN(2);
132    *(.fini9)  /* _exit() starts here.  */
133    KEEP (*(.fini9))
134    *(.fini8)
135    KEEP (*(.fini8))
136    *(.fini7)
137    KEEP (*(.fini7))
138    *(.fini6)  /* C++ destructors.  */
139    KEEP (*(.fini6))
140    *(.fini5)
141    KEEP (*(.fini5))
142    *(.fini4)
143    KEEP (*(.fini4))
144    *(.fini3)
145    KEEP (*(.fini3))
146    *(.fini2)
147    KEEP (*(.fini2))
148    *(.fini1)
149    KEEP (*(.fini1))
150    *(.fini0)  /* Infinite loop after program termination.  */
151    KEEP (*(.fini0))
152     _etext = . ;
153  }  > text
154  .tdata : AT (ADDR (.text) + SIZEOF (.text)) {
155     PROVIDE (__data_start = .) ;
156    _TLS_Data_begin = .;
157    *(.tdata .tdata.* .gnu.linkonce.td.*)
158    _TLS_Data_end = .;
159  }  > data
160  .tbss : {
161    _TLS_BSS_begin = .;
162    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
163    _TLS_BSS_end = .;
164  }  > data
165  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
166  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
167  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
168  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
169  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
170  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
171  .data   :
172  {
173    *(.data)
174    *(.data*)
175    KEEP (*(SORT(.rtemsrwset.*)))
176    *(.rodata)  /* We need to include .rodata here if gcc is used */
177    *(.rodata*) /* with -fdata-sections.  */
178    KEEP (*(SORT(.rtemsroset.*)))
179    *(.gnu.linkonce.d*)
180    . = ALIGN(2);
181     _edata = . ;
182     PROVIDE (__data_end = .) ;
183  }  > data
184  .bss  SIZEOF(.data) + ADDR(.data) :
185  {
186     PROVIDE (__bss_start = .) ;
187    *(.bss)
188    *(.bss*)
189    *(COMMON)
190     PROVIDE (__bss_end = .) ;
191  . = ALIGN(16);
192
193  . += StackSize;
194  PROVIDE (__stack = .);
195  PROVIDE (WorkAreaBase = .);
196  }  > data
197   __data_load_start = LOADADDR(.data);
198   __data_load_end = __data_load_start + SIZEOF(.data);
199  /* Global data not cleared after reset.  */
200  .noinit  SIZEOF(.bss) + ADDR(.bss) :
201  {
202     PROVIDE (__noinit_start = .) ;
203    *(.noinit*)
204     PROVIDE (__noinit_end = .) ;
205     _end = . ;
206     PROVIDE (__heap_start = .) ;
207  }  > data
208  .eeprom  :
209  {
210    *(.eeprom*)
211     __eeprom_end = . ;
212  }  > eeprom
213  /* Stabs debugging sections.  */
214  .stab 0 : { *(.stab) }
215  .stabstr 0 : { *(.stabstr) }
216  .stab.excl 0 : { *(.stab.excl) }
217  .stab.exclstr 0 : { *(.stab.exclstr) }
218  .stab.index 0 : { *(.stab.index) }
219  .stab.indexstr 0 : { *(.stab.indexstr) }
220  .comment 0 : { *(.comment) }
221  /* DWARF debug sections.
222     Symbols in the DWARF debugging sections are relative to the beginning
223     of the section so we begin them at 0.  */
224  /* DWARF 1 */
225  .debug          0 : { *(.debug) }
226  .line           0 : { *(.line) }
227  /* GNU DWARF 1 extensions */
228  .debug_srcinfo  0 : { *(.debug_srcinfo) }
229  .debug_sfnames  0 : { *(.debug_sfnames) }
230  /* DWARF 1.1 and DWARF 2 */
231  .debug_aranges  0 : { *(.debug_aranges) }
232  .debug_pubnames 0 : { *(.debug_pubnames) }
233  /* DWARF 2 */
234  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
235  .debug_abbrev   0 : { *(.debug_abbrev) }
236  .debug_line     0 : { *(.debug_line) }
237  .debug_frame    0 : { *(.debug_frame) }
238  .debug_str      0 : { *(.debug_str) }
239  .debug_loc      0 : { *(.debug_loc) }
240  .debug_macinfo  0 : { *(.debug_macinfo) }
241}
Note: See TracBrowser for help on using the repository browser.