source: rtems/c/src/lib/libbsp/arm/rtl22xx/startup/linkcmds @ e890774

4.104.114.84.9
Last change on this file since e890774 was e890774, checked in by Joel Sherrill <joel.sherrill@…>, on May 1, 2007 at 7:15:38 PM

2007-05-01 Ray Xu <xr@…>

  • README, times, console/lpc22xx_uart.h, console/uart.c, include/bsp.h, start/start.S, startup/bspstart.c, startup/exit.c, startup/linkcmds: Update BSP to address changes between 4.7 and CVS head as well as to address comments from Ralf and Joel.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*
2 * Philips lpc ARM linker script
3 * By Ray,Xu
4 * Rayx.cn@gmail.com
5 *     
6 *  LPC22xx ARM do not have a MMU, the formatter got 512kb SRAM
7 *  I set the code entry to the beging of SRAM for debugging perpurse
8 *     
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *
15 *  $Id$
16 */
17
18OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
19              "elf32-littlearm")
20OUTPUT_ARCH(arm)
21ENTRY(_start)
22
23
24MEMORY {
25        sdram : ORIGIN = 0x81000000, LENGTH = 512K
26        sram : ORIGIN = 0x40000000, LENGTH = 16K
27        regs  : ORIGIN = 0xe0000000, LENGTH = 2M
28}
29
30/*
31 * Declare some sizes.
32 */
33
34_sdram_base = DEFINED(_sdram_base) ? _sdram_base : 0x81000000;
35_sdram_size = DEFINED(_sdram_size) ? _sdram_size : 512K;
36
37
38_irq_stack_size = DEFINED(_irq_stack_size) ? _irq_stack_size : 0x100;
39_fiq_stack_size = DEFINED(_fiq_stack_size) ? _fiq_stack_size : 0x50;
40_abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0x50;
41_svc_stack_size = DEFINED(_svc_stack_size) ? _svc_stack_size : 0x500;
42
43
44
45/* Do we need any of these for elf?
46   __DYNAMIC = 0;    */
47
48SECTIONS
49{
50  .base :
51  {
52    _sram_base = .;
53    arm_exception_table = .;   
54
55    arm_reset_vect    = .;     /* 0x00 */
56    . += 4;
57
58    arm_undef_vect    = .;     /* 0x04 */
59    . += 4;
60
61    arm_swi_vect      = .;     /* 0x08 */
62    . += 4;
63
64    arm_iabrt_vect    = .;     /* 0x0c */
65    . += 4;
66
67    arm_dabrt_vect    = .;     /* 0x10 */
68    . += 4;
69
70    /* no vector here */
71    . += 4;
72
73    arm_irq_vect      = .;     /* 0x18 */
74    . += 4;
75
76    arm_fiq_vect      = .;     /* 0x1c */
77    . += 4;
78
79
80    rtems_vector_table = .;
81    . += (8 * 4);                     /* 8 ARM interrupts */
82       
83    /*bsp_vector_table = .;*/
84     /*. += (64 * 4);                    64 LPC22xx interrupts */
85
86    . = ALIGN (0x100);
87
88  } > sram
89
90
91  .text      :
92  {
93        _text_start = .;
94         CREATE_OBJECT_SYMBOLS
95        *(.text)
96        *(.text.*)
97
98        /*
99         * Special FreeBSD sysctl sections.
100         */
101        . = ALIGN (16);
102        __start_set_sysctl_set = .;
103        *(set_sysctl_*);
104        __stop_set_sysctl_set = ABSOLUTE(.);
105        *(set_domain_*);
106        *(set_pseudo_*);
107
108        /* .gnu.warning sections are handled specially by elf32.em.  */
109        *(.gnu.warning)
110        *(.gnu.linkonce.t*)
111        *(.glue_7)
112        *(.glue_7t)
113
114        /* I think these come from the ld docs: */     
115        ___CTOR_LIST__ = .;
116        LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)
117        *(.ctors)
118        LONG(0)
119        ___CTOR_END__ = .;
120        ___DTOR_LIST__ = .;
121        LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)
122        *(.dtors)
123        LONG(0)
124        ___DTOR_END__ = .;
125
126        _etext = .;
127        PROVIDE (etext = .);
128  } > sdram 
129
130  .init          :
131  {
132    KEEP (*(.init))
133  } > sdram   /*=0*/
134
135  .fini      :
136  {
137    KEEP (*(.fini))
138  } > sdram  /*=0*/
139
140  .data :
141  {
142    *(.data)
143    *(.data.*)
144    *(.gnu.linkonce.d*)
145    *(.jcr)
146    SORT(CONSTRUCTORS)
147    _edata = .;
148  } > sdram
149
150  .eh_frame : { *(.eh_frame) } > sdram
151  .data1   : { *(.data1) } > sdram
152  .eh_frame : { *(.eh_frame) } > sdram
153  .gcc_except_table : { *(.gcc_except_table) } > sdram
154
155  .rodata :
156  {
157    *(.rodata)
158    *(.rodata.*)
159    *(.gnu.linkonce.r*)
160  } > sdram
161
162  .bss       :
163  {
164        _bss_start_ = .;
165        _clear_start = .;
166        *(.bss)
167        *(.bss.*)
168        *(.gnu.linkonce.b.*)
169        *(COMMON)
170        . = ALIGN(256);
171        _clear_end = .;
172
173        . = ALIGN (64);
174        _abt_stack = .;
175        . += _abt_stack_size;
176
177        . = ALIGN (256);
178        _irq_stack = .;
179        . += _irq_stack_size;
180
181        . = ALIGN (64);
182        _fiq_stack = .;
183        . += _fiq_stack_size;
184
185        . = ALIGN (64);
186        _svc_stack = .;
187        . += _svc_stack_size;
188
189        _bss_end_ = .;
190        _end = .;
191        __end = .;
192
193        _bss_free_start = .;
194        . = ALIGN (1024);
195  } > sdram
196
197/*
198  .regs :
199  {
200        lpc22xx_regs_base = .;
201        lpc22xx_regs = .;
202        . += 8192;
203  } > regs
204*/
205
206
207/* Debugging stuff follows? */
208
209  /* Stabs debugging sections.  */
210  .stab 0 : { *(.stab) }
211  .stabstr 0 : { *(.stabstr) }
212  .stab.excl 0 : { *(.stab.excl) }
213  .stab.exclstr 0 : { *(.stab.exclstr) }
214  .stab.index 0 : { *(.stab.index) }
215  .stab.indexstr 0 : { *(.stab.indexstr) }
216  .comment 0 : { *(.comment) }
217  /* DWARF debug sections.
218     Symbols in the DWARF debugging sections are relative to the beginning
219     of the section so we begin them at 0.  */
220  /* DWARF 1 */
221  .debug          0 : { *(.debug) }
222  .line           0 : { *(.line) }
223  /* GNU DWARF 1 extensions */
224  .debug_srcinfo  0 : { *(.debug_srcinfo) }
225  .debug_sfnames  0 : { *(.debug_sfnames) }
226  /* DWARF 1.1 and DWARF 2 */
227  .debug_aranges  0 : { *(.debug_aranges) }
228  .debug_pubnames 0 : { *(.debug_pubnames) }
229  /* DWARF 2 */
230  .debug_info     0 : { *(.debug_info) }
231  .debug_abbrev   0 : { *(.debug_abbrev) }
232  .debug_line     0 : { *(.debug_line) }
233  .debug_frame    0 : { *(.debug_frame) }
234  .debug_str      0 : { *(.debug_str) }
235  .debug_loc      0 : { *(.debug_loc) }
236  .debug_macinfo  0 : { *(.debug_macinfo) }
237
238  /*.stack 0x80000 : { _stack = .; *(.stack) }*/
239  /* These must appear regardless of  .  */
240}
241
Note: See TracBrowser for help on using the repository browser.