* scripttempl/armbpabi.sc: Replace DWARF sections with an
[deliverable/binutils-gdb.git] / ld / scripttempl / elfd10v.sc
1 test -z "$ENTRY" && ENTRY=_start
2 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
3 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
4 if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
5 test "$LD_FLAG" = "N" && DATA_ADDR=.
6 INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
7 PLT=".plt ${RELOCATING-0} : { *(.plt) }"
8
9
10 CTOR=".ctors ${CONSTRUCTING-0} :
11 {
12 ${CONSTRUCTING+${CTOR_START}}
13 /* gcc uses crtbegin.o to find the start of
14 the constructors, so we make sure it is
15 first. Because this is a wildcard, it
16 doesn't matter if the user does not
17 actually link against crtbegin.o; the
18 linker won't look for a file to match a
19 wildcard. The wildcard also means that it
20 doesn't matter which directory crtbegin.o
21 is in. */
22
23 KEEP (*crtbegin.o(.ctors))
24 KEEP (*crtbegin?.o(.ctors))
25
26 /* We don't want to include the .ctor section from
27 the crtend.o file until after the sorted ctors.
28 The .ctor section from the crtend file contains the
29 end of ctors marker and it must be last */
30
31 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))
32 KEEP (*(SORT(.ctors.*)))
33 KEEP (*(.ctors))
34 ${CONSTRUCTING+${CTOR_END}}
35 }"
36
37 DTOR=" .dtors ${CONSTRUCTING-0} :
38 {
39 ${CONSTRUCTING+${DTOR_START}}
40 KEEP (*crtbegin.o(.dtors))
41 KEEP (*crtbegin?.o(.dtors))
42 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors))
43 KEEP (*(SORT(.dtors.*)))
44 KEEP (*(.dtors))
45 ${CONSTRUCTING+${DTOR_END}}
46 }"
47
48 STACK=" .stack : { _stack = .; *(.stack) } >STACK "
49
50 # if this is for an embedded system, don't add SIZEOF_HEADERS.
51 if [ -z "$EMBEDDED" ]; then
52 test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR} + SIZEOF_HEADERS"
53 else
54 test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR}"
55 fi
56
57 cat <<EOF
58 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
59 "${LITTLE_OUTPUT_FORMAT}")
60 OUTPUT_ARCH(${OUTPUT_ARCH})
61 ${RELOCATING+ENTRY(${ENTRY})}
62
63 ${RELOCATING+${LIB_SEARCH_DIRS}}
64 ${RELOCATING+/* Do we need any of these for elf?
65 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
66 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
67
68 MEMORY
69 {
70 /* These are the values for the D10V-TS3 board.
71 There are other memory regions available on
72 the TS3 (eg ROM, FLASH, etc) but these are not
73 used by this script. */
74
75 INSN : org = 0x01000000, len = 256K
76 DATA : org = 0x02000000, len = 48K
77
78 /* This is a fake memory region at the top of the
79 on-chip RAM, used as the start of the
80 (descending) stack. */
81
82 STACK : org = 0x0200BFFC, len = 4
83 }
84
85 SECTIONS
86 {
87 .text ${RELOCATING+${TEXT_START_ADDR}} :
88 {
89 ${RELOCATING+${TEXT_START_SYMBOLS}}
90 KEEP (*(SORT_NONE(.init)))
91 KEEP (*(SORT_NONE(.init.*)))
92 KEEP (*(SORT_NONE(.fini)))
93 KEEP (*(SORT_NONE(.fini.*)))
94 *(.text)
95 *(.text.*)
96 /* .gnu.warning sections are handled specially by elf32.em. */
97 *(.gnu.warning)
98 *(.gnu.linkonce.t*)
99 ${RELOCATING+_etext = .;}
100 ${RELOCATING+PROVIDE (etext = .);}
101 } ${RELOCATING+ >INSN} =${NOP-0}
102
103 .rodata ${RELOCATING+${READONLY_START_ADDR}} : {
104 *(.rodata)
105 *(.gnu.linkonce.r*)
106 *(.rodata.*)
107 } ${RELOCATING+ >DATA}
108
109 .rodata1 ${RELOCATING-0} : {
110 *(.rodata1)
111 *(.rodata1.*)
112 } ${RELOCATING+ >DATA}
113
114 .data ${RELOCATING-0} :
115 {
116 ${RELOCATING+${DATA_START_SYMBOLS}}
117 *(.data)
118 *(.data.*)
119 *(.gnu.linkonce.d*)
120 ${CONSTRUCTING+CONSTRUCTORS}
121 } ${RELOCATING+ >DATA}
122
123 .data1 ${RELOCATING-0} : {
124 *(.data1)
125 *(.data1.*)
126 } ${RELOCATING+ >DATA}
127
128 ${RELOCATING+${CTOR} >DATA}
129 ${RELOCATING+${DTOR} >DATA}
130
131 /* We want the small data sections together, so single-instruction offsets
132 can access them all, and initialized data all before uninitialized, so
133 we can shorten the on-disk segment size. */
134 .sdata ${RELOCATING-0} : {
135 *(.sdata)
136 *(.sdata.*)
137 } ${RELOCATING+ >DATA}
138
139 ${RELOCATING+_edata = .;}
140 ${RELOCATING+PROVIDE (edata = .);}
141 ${RELOCATING+__bss_start = .;}
142 .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
143 .bss ${RELOCATING-0} :
144 {
145 *(.dynbss)
146 *(.dynbss.*)
147 *(.bss)
148 *(.bss.*)
149 *(COMMON)
150 } ${RELOCATING+ >DATA}
151
152 ${RELOCATING+_end = . ;}
153 ${RELOCATING+PROVIDE (end = .);}
154
155 ${RELOCATING+$STACK}
156
157 /* Stabs debugging sections. */
158 .stab 0 : { *(.stab) }
159 .stabstr 0 : { *(.stabstr) }
160 .stab.excl 0 : { *(.stab.excl) }
161 .stab.exclstr 0 : { *(.stab.exclstr) }
162 .stab.index 0 : { *(.stab.index) }
163 .stab.indexstr 0 : { *(.stab.indexstr) }
164
165 .comment 0 : { *(.comment) }
166
167 EOF
168
169 source $srcdir/scripttempl/DWARF.sc
170
171 cat <<EOF
172 }
173 EOF
This page took 0.034566 seconds and 4 git commands to generate.