ELF ld -r scripts
[external/binutils.git] / ld / scripttempl / elf32xc16xl.sc
1 # Copyright (C) 2014-2018 Free Software Foundation, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.
6
7 cat <<EOF
8 /* Copyright (C) 2014-2018 Free Software Foundation, Inc.
9
10    Copying and distribution of this script, with or without modification,
11    are permitted in any medium without royalty provided the copyright
12    notice and this notice are preserved.  */
13
14 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
15 OUTPUT_ARCH(${ARCH})
16 EOF
17
18 test -n "${RELOCATING}" && cat <<EOF
19 ENTRY ("_start")
20 MEMORY
21 {
22         vectarea : o =0xc00000, l = 0x0300
23
24         introm    : o = 0xc00300, l = 0x16000
25         /* The stack starts at the top of main ram.  */
26
27         dram   : o = 0x8000 , l = 0xffff
28         /* At the very top of the address space is the 8-bit area.  */
29
30         ldata   : o =0x4000 ,l = 0x0200
31 }
32 EOF
33
34 cat <<EOF
35 SECTIONS
36 {
37 /*.vects :
38         {
39           *(.vects)
40         } ${RELOCATING+ > vectarea} */
41 .init :
42         {
43           *(.init)
44         } ${RELOCATING+ >introm}
45
46 .text :
47         {
48           ${RELOCATING+*(.rodata)}
49           ${RELOCATING+*(.text.*)}
50           *(.text)
51           ${RELOCATING+ _etext = . ; }
52         } ${RELOCATING+ > introm}
53 .data :
54         {
55           *(.data)
56           ${RELOCATING+*(.data.*)}
57
58           ${RELOCATING+ _edata = . ; }
59         } ${RELOCATING+ > dram}
60
61 .bss :
62         {
63           ${RELOCATING+ _bss_start = . ;}
64           *(.bss)
65           ${RELOCATING+*(COMMON)}
66           ${RELOCATING+ _end = . ;  }
67         } ${RELOCATING+ > dram}
68
69 .ldata :
70         {
71           *(.ldata)
72         } ${RELOCATING+ > ldata}
73
74 .vects :
75         {
76           *(.vects)
77         } ${RELOCATING+ > vectarea}
78 }
79 EOF