* m32r/tm-m32r.h (TARGET_M32R): Define, for wingdb.
[deliverable/binutils-gdb.git] / ld / scripttempl / elfppc.sc
1 #
2 # Unusual variables checked by this code:
3 # NOP - two byte opcode for no-op (defaults to 0)
4 # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
5 # OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
6 # (e.g., .PARISC.milli)
7 # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
8 # (e.g., .PARISC.global)
9 # OTHER_SECTIONS - at the end
10 # EXECUTABLE_SYMBOLS - symbols that must be defined for an
11 # executable (e.g., _DYNAMIC_LINK)
12 # TEXT_START_SYMBOLS - symbols that appear at the start of the
13 # .text section.
14 # DATA_START_SYMBOLS - symbols that appear at the start of the
15 # .data section.
16 # OTHER_BSS_SYMBOLS - symbols that appear at the start of the
17 # .bss section besides __bss_start.
18 # DATA_PLT - .plt should be in data segment, not text segment.
19 #
20 # When adding sections, do note that the names of some sections are used
21 # when specifying the start address of the next.
22 #
23 test -z "$ENTRY" && ENTRY=_start
24 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
25 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
26 test "$LD_FLAG" = "N" && DATA_ADDR=.
27 SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }"
28 SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }"
29 INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
30 PLT=".plt ${RELOCATING-0} : { *(.plt) }"
31 cat <<EOF
32 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
33 "${LITTLE_OUTPUT_FORMAT}")
34 OUTPUT_ARCH(${ARCH})
35 ENTRY(${ENTRY})
36
37 ${RELOCATING+${LIB_SEARCH_DIRS}}
38 ${RELOCATING+/* Do we need any of these for elf?
39 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
40 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
41 ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
42 if gld -r is used and the intermediate file has sections starting
43 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
44 bug. But for now assigning the zero vmas works. */}
45
46 ${RELOCATING+PROVIDE (__stack = 0);}
47 SECTIONS
48 {
49 /* Read-only sections, merged into text segment: */
50 ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
51 ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
52 ${CREATE_SHLIB-${INTERP}}
53 .hash ${RELOCATING-0} : { *(.hash) }
54 .dynsym ${RELOCATING-0} : { *(.dynsym) }
55 .dynstr ${RELOCATING-0} : { *(.dynstr) }
56 .rela.text ${RELOCATING-0} :
57 { *(.rela.text) *(.rela.gnu.linkonce.t*) }
58 .rela.data ${RELOCATING-0} :
59 { *(.rela.data) *(.rela.gnu.linkonce.d*) }
60 .rela.rodata ${RELOCATING-0} :
61 { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
62 .rela.got ${RELOCATING-0} : { *(.rela.got) }
63 .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
64 .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
65 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
66 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
67 .rela.init ${RELOCATING-0} : { *(.rela.init) }
68 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
69 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
70 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
71 .rela.sdata ${RELOCATING-0} : { *(.rela.sdata2) }
72 .rela.sbss ${RELOCATING-0} : { *(.rela.sbss2) }
73 .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) }
74 .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) }
75 ${DATA_PLT-${PLT}}
76 .text ${RELOCATING-0} :
77 {
78 ${RELOCATING+${TEXT_START_SYMBOLS}}
79 *(.text)
80 /* .gnu.warning sections are handled specially by elf32.em. */
81 *(.gnu.warning)
82 *(.gnu.linkonce.t*)
83 } =${NOP-0}
84 .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
85 .fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
86 .rodata ${RELOCATING-0} : { *(.rodata) *(.gnu.linkonce.r*) }
87 .rodata1 ${RELOCATING-0} : { *(.rodata1) }
88 ${RELOCATING+_etext = .;}
89 ${RELOCATING+PROVIDE (etext = .);}
90 ${CREATE_SHLIB-${SDATA2}}
91 ${CREATE_SHLIB-${SBSS2}}
92 ${RELOCATING+${OTHER_READONLY_SECTIONS}}
93
94 /* Adjust the address for the data segment. We want to adjust up to
95 the same address within the page on the next page up. It would
96 be more correct to do this:
97 ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};}
98 The current expression does not correctly handle the case of a
99 text segment ending precisely at the end of a page; it causes the
100 data segment to skip a page. The above expression does not have
101 this problem, but it will currently (2/95) cause BFD to allocate
102 a single segment, combining both text and data, for this case.
103 This will prevent the text segment from being shared among
104 multiple executions of the program; I think that is more
105 important than losing a page of the virtual address space (note
106 that no actual memory is lost; the page which is skipped can not
107 be referenced). */
108 ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
109
110 .data ${RELOCATING-0} :
111 {
112 ${RELOCATING+${DATA_START_SYMBOLS}}
113 *(.data)
114 *(.gnu.linkonce.d*)
115 ${CONSTRUCTING+CONSTRUCTORS}
116 }
117 .data1 ${RELOCATING-0} : { *(.data1) }
118 ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
119
120 .got1 ${RELOCATING-0} : { *(.got1) }
121 .dynamic ${RELOCATING-0} : { *(.dynamic) }
122
123 /* Put .ctors and .dtors next to the .got2 section, so that the pointers
124 get relocated with -mrelocatable. Also put in the .fixup pointers.
125 The current compiler no longer needs this, but keep it around for 2.7.2 */
126
127 ${RELOCATING+PROVIDE (_GOT2_START_ = .);}
128 .got2 ${RELOCATING-0} : { *(.got2) }
129
130 ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
131 .ctors ${RELOCATING-0} : { *(.ctors) }
132 ${RELOCATING+PROVIDE (__CTOR_END__ = .);}
133
134 ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
135 .dtors ${RELOCATING-0} : { *(.dtors) }
136 ${RELOCATING+PROVIDE (__DTOR_END__ = .);}
137
138 ${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
139 .fixup ${RELOCATING-0} : { *(.fixup) }
140 ${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
141 ${RELOCATING+PROVIDE (_GOT2_END_ = .);}
142
143 ${RELOCATING+PROVIDE (_GOT_START_ = .);}
144 .got ${RELOCATING-0} : { *(.got) }
145 .got.plt ${RELOCATING-0} : { *(.got.plt) }
146 ${CREATE_SHLIB+${SDATA2}}
147 ${CREATE_SHLIB+${SBSS2}}
148 ${RELOCATING+PROVIDE (_GOT_END_ = .);}
149
150 ${DATA_PLT+${PLT}}
151 /* We want the small data sections together, so single-instruction offsets
152 can access them all, and initialized data all before uninitialized, so
153 we can shorten the on-disk segment size. */
154 .sdata ${RELOCATING-0} : { *(.sdata) }
155 ${RELOCATING+_edata = .;}
156 ${RELOCATING+PROVIDE (edata = .);}
157 .sbss ${RELOCATING-0} :
158 {
159 ${RELOCATING+PROVIDE (__sbss_start = .);}
160 *(.sbss)
161 *(.scommon)
162 ${RELOCATING+PROVIDE (__sbss_end = .);}
163 }
164 .bss ${RELOCATING-0} :
165 {
166 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
167 ${RELOCATING+PROVIDE (__bss_start = .);}
168 *(.dynbss)
169 *(.bss)
170 *(COMMON)
171 }
172 ${RELOCATING+_end = . ;}
173 ${RELOCATING+PROVIDE (end = .);}
174
175 /* These are needed for ELF backends which have not yet been
176 converted to the new style linker. */
177 .stab 0 : { *(.stab) }
178 .stabstr 0 : { *(.stabstr) }
179
180 /* DWARF debug sections.
181 Symbols in the DWARF debugging sections are relative to the beginning
182 of the section so we begin them at 0. */
183
184 /* DWARF 1 */
185 .debug 0 : { *(.debug) }
186 .line 0 : { *(.line) }
187
188 /* GNU DWARF 1 extensions */
189 .debug_srcinfo 0 : { *(.debug_srcinfo) }
190 .debug_sfnames 0 : { *(.debug_sfnames) }
191
192 /* DWARF 1.1 and DWARF 2 */
193 .debug_aranges 0 : { *(.debug_aranges) }
194 .debug_pubnames 0 : { *(.debug_pubnames) }
195
196 /* DWARF 2 */
197 .debug_info 0 : { *(.debug_info) }
198 .debug_abbrev 0 : { *(.debug_abbrev) }
199 .debug_line 0 : { *(.debug_line) }
200 .debug_frame 0 : { *(.debug_frame) }
201 .debug_str 0 : { *(.debug_str) }
202 .debug_loc 0 : { *(.debug_loc) }
203 .debug_macinfo 0 : { *(.debug_macinfo) }
204
205 /* SGI/MIPS DWARF 2 extensions */
206 .debug_weaknames 0 : { *(.debug_weaknames) }
207 .debug_funcnames 0 : { *(.debug_funcnames) }
208 .debug_typenames 0 : { *(.debug_typenames) }
209 .debug_varnames 0 : { *(.debug_varnames) }
210
211 /* These must appear regardless of ${RELOCATING}. */
212 ${OTHER_SECTIONS}
213 }
214 EOF
This page took 0.033663 seconds and 4 git commands to generate.