ld: add support for eBPF
[external/binutils.git] / ld / scripttempl / elf32xc16xs.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         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
33 EOF
34
35 cat <<EOF
36 SECTIONS
37 {
38 /*.vects :
39         {
40           *(.vects)
41         } ${RELOCATING+ > vectarea} */
42 .init :
43         {
44           KEEP (*(SORT_NONE(.init)))
45           ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
46         } ${RELOCATING+ >introm}
47
48 .text :
49         {
50           ${RELOCATING+*(.rodata)}
51           ${RELOCATING+*(.text.*)}
52           *(.text)
53           ${RELOCATING+ _etext = . ; }
54         } ${RELOCATING+ > introm}
55 .data :
56         {
57           *(.data)
58           ${RELOCATING+*(.data.*)}
59
60           ${RELOCATING+ _edata = . ; }
61         } ${RELOCATING+ > dram}
62
63 .bss :
64         {
65           ${RELOCATING+ _bss_start = . ;}
66           *(.bss)
67           ${RELOCATING+*(COMMON)}
68           ${RELOCATING+ _end = . ;  }
69         } ${RELOCATING+ > dram}
70
71 .ldata :
72         {
73           *(.ldata)
74         } ${RELOCATING+ > ldata}
75
76 .vects :
77         {
78           *(.vects)
79         } ${RELOCATING+ > vectarea}
80 }
81 EOF