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