CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gcc_arm_generic_one_sect.ld
Go to the documentation of this file.
1 /* Library configurations */
2 GROUP(libgcc.a libc.a libm.a libnosys.a)
3 
4 /* Linker script to place sections and symbol values. Should be used together
5  * with other linker script that defines memory regions FLASH and RAM.
6  * It references following symbols, which must be defined in code:
7  * Reset_Handler : Entry of reset handler
8  *
9  * It defines following symbols, which code can use without definition:
10  * __exidx_start
11  * __exidx_end
12  * _etext
13  * __data_start
14  * __preinit_array_start
15  * __preinit_array_end
16  * __init_array_start
17  * __init_array_end
18  * __fini_array_start
19  * __fini_array_end
20  * __data_end
21  * __bss_start
22  * __bss_end
23  * __end
24  * end
25  * __HeapLimit
26  * __StackLimit
27  * __StackTop
28  * __stack
29  */
31 
32 SECTIONS
33 {
34  .text :
35  {
36  KEEP(*(.isr_vector))
37  *(.text*)
38 
39  KEEP(*(.init))
40  KEEP(*(.fini))
41 
42  /* .ctors */
43  *crtbegin.o(.ctors)
44  *crtbegin?.o(.ctors)
45  *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
46  *(SORT(.ctors.*))
47  *(.ctors)
48 
49  /* .dtors */
50  *crtbegin.o(.dtors)
51  *crtbegin?.o(.dtors)
52  *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
53  *(SORT(.dtors.*))
54  *(.dtors)
55 
56  *(.rodata*)
57 
58  KEEP(*(.eh_frame*))
59  } > onesect
60 
61  .ARM.extab :
62  {
63  *(.ARM.extab* .gnu.linkonce.armextab.*)
64  } > onesect
65 
66  __exidx_start = .;
67  .ARM.exidx :
68  {
69  *(.ARM.exidx* .gnu.linkonce.armexidx.*)
70  } > onesect
71  __exidx_end = .;
72 
73  _etext = .;
74 
75  .data :
76  {
77  PROVIDE (__data_start = .);
78  *(vtable)
79  *(.data*)
80 
81  . = ALIGN(4);
82  /* preinit data */
83  PROVIDE_HIDDEN (__preinit_array_start = .);
84  KEEP(*(.preinit_array))
85  PROVIDE_HIDDEN (__preinit_array_end = .);
86 
87  . = ALIGN(4);
88  /* init data */
89  PROVIDE_HIDDEN (__init_array_start = .);
90  KEEP(*(SORT(.init_array.*)))
91  KEEP(*(.init_array))
92  PROVIDE_HIDDEN (__init_array_end = .);
93 
94 
95  . = ALIGN(4);
96  /* finit data */
97  PROVIDE_HIDDEN (__fini_array_start = .);
98  KEEP(*(SORT(.fini_array.*)))
99  KEEP(*(.fini_array))
100  PROVIDE_HIDDEN (__fini_array_end = .);
101 
102  . = ALIGN(4);
103  /* All data end */
104  //__data_end = .;
105  PROVIDE (__data_end = .) ;
106 
107  } > onesect
108 
109  .bss :
110  {
111  __bss_start = .;
112  *(.bss*)
113  *(COMMON)
114  __bss_end = .;
115  } > onesect
116 
117  .heap :
118  {
119  __end = .;
120  end = __end;
121  *(.heap*)
122  __HeapLimit = .;
123  } > onesect
124 
125  /* .stack_dummy section doesn't contains any symbols. It is only
126  * used for linker to calculate size of stack sections, and assign
127  * values to stack symbols later */
128  .stack_dummy :
129  {
130  *(.stack)
131  } > onesect
132 
133  /* Set stack top to end of RAM, and stack limit move down by
134  * size of stack_dummy section */
135  __StackTop = ORIGIN(RAM) + LENGTH(RAM);
136  __StackLimit = __StackTop - SIZEOF(.stack_dummy);
137  PROVIDE(__stack = __StackTop);
138 
139  /* Check if data + heap + stack exceeds RAM limit
140  ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
141  */
142 
143  .ram2_sect (NOLOAD):
144  {
145  *(.usbram*)
146  *(.usb_ram*)
147  *(.USB_RAM*)
148 
149  *(.ethram*)
150  *(.eth_ram*)
151  *(.eth_RAM*)
152  }>RAM2
153 }