Allow the flash and ram memory region sizes to be specified in the default FT32 linke...
[deliverable/binutils-gdb.git] / ld / scripttempl / ft32.sc
1 TORS=".tors :
2 {
3 ___ctors = . ;
4 *(.ctors)
5 ___ctors_end = . ;
6 ___dtors = . ;
7 *(.dtors)
8 ___dtors_end = . ;
9 . = ALIGN(4);
10 } > ram"
11
12 cat <<EOF
13 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
14 OUTPUT_ARCH(${ARCH})
15 ${LIB_SEARCH_DIRS}
16
17 /* Allow the command line to override the memory region sizes. */
18 __PMSIZE_ = DEFINED(__PMSIZE) ? __PMSIZE : 256K;
19 __RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K;
20
21 MEMORY
22 {
23 flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE
24 ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
25 }
26
27 SECTIONS
28 {
29 .text :
30 {
31 *(.text*)
32 *(.strings)
33 *(._pm*)
34 *(.init)
35 *(.fini)
36 ${RELOCATING+ _etext = . ; }
37 . = ALIGN(4);
38 } ${RELOCATING+ > flash}
39 ${CONSTRUCTING+${TORS}}
40 .data : ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))}
41 {
42 *(.data)
43 *(.rodata)
44 *(.rodata*)
45 ${RELOCATING+ _edata = . ; }
46 } ${RELOCATING+ > ram}
47 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
48 {
49 ${RELOCATING+ _bss_start = . ; }
50 *(.bss)
51 *(COMMON)
52 ${RELOCATING+ _end = . ; }
53 } ${RELOCATING+ > ram}
54
55 ${RELOCATING+ __data_load_start = LOADADDR(.data); }
56 ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
57
58 .stab 0 ${RELOCATING+(NOLOAD)} :
59 {
60 *(.stab)
61 }
62 .stabstr 0 ${RELOCATING+(NOLOAD)} :
63 {
64 *(.stabstr)
65 }
66 EOF
67
68 . $srcdir/scripttempl/DWARF.sc
69
70 cat <<EOF
71 }
72 EOF
This page took 0.033376 seconds and 5 git commands to generate.