b4325585fd50e19b622594882c01b179c76fda76
[external/binutils.git] / ld / scripttempl / elf32xc16x.sc
1 # Copyright (C) 2014-2019 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-2019 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
23         vectarea : o =0x00000, l = 0x0300
24
25         introm    : o = 0x00400, l = 0x16000
26         /* The stack starts at the top of main ram.  */
27
28         dram   : o = 0x8000 , l = 0xffff
29         /* At the very top of the address space is the 8-bit area.  */
30
31         ldata  : o =0x4000 ,l = 0x0200
32 }
33
34 EOF
35
36 cat <<EOF
37 SECTIONS
38 {
39 .init :
40         {
41           *(.init)
42         } ${RELOCATING+ >introm}
43
44 .text :
45         {
46           ${RELOCATING+*(.rodata)}
47           ${RELOCATING+*(.text.*)}
48           *(.text)
49           ${RELOCATING+ _etext = . ; }
50         } ${RELOCATING+ > introm}
51 .data :
52         {
53           *(.data)
54           ${RELOCATING+*(.data.*)}
55
56           ${RELOCATING+ _edata = . ; }
57         } ${RELOCATING+ > dram}
58
59 .bss :
60         {
61           ${RELOCATING+ _bss_start = . ;}
62           *(.bss)
63           ${RELOCATING+*(COMMON)}
64           ${RELOCATING+ _end = . ;  }
65         } ${RELOCATING+ > dram}
66
67 .ldata :
68         {
69           *(.ldata)
70         } ${RELOCATING+ > ldata}
71
72
73 .vects :
74         {
75           *(.vects)
76         } ${RELOCATING+ > vectarea}
77
78 }
79 EOF