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) }"
10 CTOR=".ctors ${CONSTRUCTING-0} :
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
23 KEEP (*crtbegin.o(.ctors))
24 KEEP (*crtbegin?.o(.ctors))
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 */
31 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))
32 KEEP (*(SORT(.ctors.*)))
34 ${CONSTRUCTING+${CTOR_END}}
37 DTOR=" .dtors ${CONSTRUCTING-0} :
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.*)))
45 ${CONSTRUCTING+${DTOR_END}}
48 STACK=" .stack : { _stack = .; *(.stack) } >STACK "
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"
54 test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR}"
58 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
59 "${LITTLE_OUTPUT_FORMAT}")
60 OUTPUT_ARCH(${OUTPUT_ARCH})
61 ${RELOCATING+ENTRY(${ENTRY})}
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}}
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. */
75 INSN : org = 0x01000000, len = 256K
76 DATA : org = 0x02000000, len = 48K
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. */
82 STACK : org = 0x0200BFFC, len = 4
87 .text ${RELOCATING+${TEXT_START_ADDR}} :
89 ${RELOCATING+${TEXT_START_SYMBOLS}}
96 /* .gnu.warning sections are handled specially by elf32.em. */
99 ${RELOCATING+_etext = .;}
100 ${RELOCATING+PROVIDE (etext = .);}
101 } ${RELOCATING+ >INSN} =${NOP-0}
103 .rodata ${RELOCATING+${READONLY_START_ADDR}} : {
107 } ${RELOCATING+ >DATA}
109 .rodata1 ${RELOCATING-0} : {
112 } ${RELOCATING+ >DATA}
114 .data ${RELOCATING-0} :
116 ${RELOCATING+${DATA_START_SYMBOLS}}
120 ${CONSTRUCTING+CONSTRUCTORS}
121 } ${RELOCATING+ >DATA}
123 .data1 ${RELOCATING-0} : {
126 } ${RELOCATING+ >DATA}
128 ${RELOCATING+${CTOR} >DATA}
129 ${RELOCATING+${DTOR} >DATA}
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} : {
137 } ${RELOCATING+ >DATA}
139 ${RELOCATING+_edata = .;}
140 ${RELOCATING+PROVIDE (edata = .);}
141 ${RELOCATING+__bss_start = .;}
142 .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
143 .bss ${RELOCATING-0} :
150 } ${RELOCATING+ >DATA}
152 ${RELOCATING+_end = . ;}
153 ${RELOCATING+PROVIDE (end = .);}
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) }
165 .comment 0 : { *(.comment) }
167 /* DWARF debug sections.
168 Symbols in the DWARF debugging sections are relative to the beginning
169 of the section so we begin them at 0. */
172 .debug 0 : { *(.debug) }
173 .line 0 : { *(.line) }
175 /* GNU DWARF 1 extensions */
176 .debug_srcinfo 0 : { *(.debug_srcinfo) }
177 .debug_sfnames 0 : { *(.debug_sfnames) }
179 /* DWARF 1.1 and DWARF 2 */
180 .debug_aranges 0 : { *(.debug_aranges) }
181 .debug_pubnames 0 : { *(.debug_pubnames) }
184 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
185 .debug_abbrev 0 : { *(.debug_abbrev) }
186 .debug_line 0 : { *(.debug_line) }
187 .debug_frame 0 : { *(.debug_frame) }
188 .debug_str 0 : { *(.debug_str) }
189 .debug_loc 0 : { *(.debug_loc) }
190 .debug_macinfo 0 : { *(.debug_macinfo) }
192 /* SGI/MIPS DWARF 2 extensions */
193 .debug_weaknames 0 : { *(.debug_weaknames) }
194 .debug_funcnames 0 : { *(.debug_funcnames) }
195 .debug_typenames 0 : { *(.debug_typenames) }
196 .debug_varnames 0 : { *(.debug_varnames) }