File: | src/gnu/usr.bin/binutils-2.17/obj/ld/eelf_x86_64_obsd.c |
Warning: | line 187, column 3 Value stored to 'dot' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* This file is is generated by a shell script. DO NOT EDIT! */ |
2 | |
3 | /* 64 bit ELF emulation code for elf_x86_64_obsd |
4 | Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
5 | 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
6 | Written by Steve Chamberlain <sac@cygnus.com> |
7 | ELF support by Ian Lance Taylor <ian@cygnus.com> |
8 | |
9 | This file is part of GLD, the Gnu Linker. |
10 | |
11 | This program is free software; you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by |
13 | the Free Software Foundation; either version 2 of the License, or |
14 | (at your option) any later version. |
15 | |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | GNU General Public License for more details. |
20 | |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program; if not, write to the Free Software |
23 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ |
24 | |
25 | #define TARGET_IS_elf_x86_64_obsd |
26 | |
27 | #include "config.h" |
28 | #include "bfd.h" |
29 | #include "sysdep.h" |
30 | #include "libiberty.h" |
31 | #include "safe-ctype.h" |
32 | #include "getopt.h" |
33 | |
34 | #include "bfdlink.h" |
35 | |
36 | #include "ld.h" |
37 | #include "ldmain.h" |
38 | #include "ldmisc.h" |
39 | #include "ldexp.h" |
40 | #include "ldlang.h" |
41 | #include "ldfile.h" |
42 | #include "ldemul.h" |
43 | #include <ldgram.h> |
44 | #include "elf/common.h" |
45 | #include "elf-bfd.h" |
46 | |
47 | /* Declare functions used by various EXTRA_EM_FILEs. */ |
48 | static void gldelf_x86_64_obsd_before_parse (void); |
49 | static void gldelf_x86_64_obsd_after_open (void); |
50 | static void gldelf_x86_64_obsd_before_allocation (void); |
51 | static bfd_boolean gldelf_x86_64_obsd_place_orphan (asection *s); |
52 | static void gldelf_x86_64_obsd_layout_sections_again (void); |
53 | static void gldelf_x86_64_obsd_finish (void) ATTRIBUTE_UNUSED__attribute__ ((__unused__)); |
54 | |
55 | #include <sys/types.h> |
56 | #include <dirent.h> |
57 | |
58 | /* Search a directory for a .so file. */ |
59 | |
60 | static char * gldelf_x86_64_obsd_search_dir_needed (const char *dirlist, const char *filename); |
61 | |
62 | static char * gldelf_x86_64_obsd_search_dir (const char *dirname, |
63 | const char *filename, int req_maj, int req_min); |
64 | |
65 | static char * gldelf_x86_64_obsd_split_lib_name (char *name, int *pmaj, |
66 | int *pmin); |
67 | |
68 | /* THIS FUNCTION MODIFIES THE name ARGUMENT string */ |
69 | static char * |
70 | gldelf_x86_64_obsd_split_lib_name (name, pmaj, pmin) |
71 | char *name; |
72 | int *pmaj, *pmin; |
73 | { |
74 | char*eptr, *lib = name; |
75 | char *s; |
76 | int found_so = 0; |
77 | |
78 | *pmaj = -1; |
79 | *pmin = -1; |
80 | |
81 | if (strncmp(lib, "lib", 3) == 0) |
82 | lib += 3; |
83 | |
84 | s = lib; |
85 | while (found_so == 0) |
86 | { |
87 | s = strstr(s, ".so"); |
88 | |
89 | /* if .so not found, return not found, invalid lib name */ |
90 | if (s == NULL((void*)0)) |
91 | { |
92 | return NULL((void*)0); |
93 | } |
94 | |
95 | /* if .so is at end of string, fine return with pmaj/pmin -1 */ |
96 | if (s[3] == '\0') |
97 | { |
98 | *s = '\0'; |
99 | return lib; |
100 | } |
101 | |
102 | if (s[3] == '.') |
103 | { |
104 | *s = '\0'; |
105 | found_so = 1; |
106 | } |
107 | /* skip over the ".so" */ |
108 | s += 3; |
109 | } |
110 | |
111 | |
112 | /* lib[name].so.[M].[N] */ |
113 | /* s ^ */ |
114 | s += 1; |
115 | |
116 | /* lib[name].so.[M].[N] */ |
117 | /* s ^ */ |
118 | *pmaj = strtoul (s, &eptr, 10); |
119 | |
120 | /* lib[name].so.[M]X... */ |
121 | /* eptr ^ */ |
122 | if (*eptr != '.' || s == eptr) |
123 | return NULL((void*)0); /* invalid, must have minor */ |
124 | |
125 | s = eptr+1; |
126 | |
127 | /* lib[name].so.[M].[N] */ |
128 | /* s ^ */ |
129 | *pmin = strtoul (s, &eptr, 10); |
130 | |
131 | /* lib[name].so.[M].[N] */ |
132 | /* eptr ^ */ |
133 | if (*eptr != '\0' || s == eptr) |
134 | return NULL((void*)0); /* minor must be last field of library */ |
135 | |
136 | return lib; |
137 | } |
138 | |
139 | static char * |
140 | gldelf_x86_64_obsd_search_dir_needed (dirlist, filename) |
141 | const char *dirlist; |
142 | const char *filename; |
143 | { |
144 | char *dlist, *dlist_alloc, *dir; |
145 | char *fnam, *fnam_alloc, *lib; |
146 | char *found = NULL((void*)0); |
147 | int maj = -1, min = -1; |
148 | |
149 | dlist_alloc = dlist = xstrdup(dirlist); |
150 | fnam_alloc = fnam = xstrdup(filename); |
151 | |
152 | lib = gldelf_x86_64_obsd_split_lib_name(fnam, &maj, &min); |
153 | |
154 | while (lib != NULL((void*)0) && found == NULL((void*)0)) |
155 | { |
156 | dir = strsep(&dlist, ":"); |
157 | if (dir == NULL((void*)0)) |
158 | break; |
159 | if (*dir == '\0') |
160 | continue; /* skip dirlist of ...::... */ |
161 | found = gldelf_x86_64_obsd_search_dir(dir, lib, maj, min); |
162 | } |
163 | |
164 | free(dlist_alloc); |
165 | free(fnam_alloc); |
166 | return found; |
167 | } |
168 | |
169 | |
170 | static char * |
171 | gldelf_x86_64_obsd_search_dir (dirname, filename, req_maj, req_min) |
172 | const char *dirname; |
173 | const char *filename; |
174 | int req_maj, req_min; |
175 | { |
176 | const char *dot; |
177 | unsigned int len; |
178 | char *found; |
179 | int max_maj, max_min; |
180 | DIR *dir; |
181 | struct dirent *entry; |
182 | unsigned int dirnamelen; |
183 | char *full_path; |
184 | int statval; |
185 | struct stat st; |
186 | |
187 | dot = strchr (filename, '.'); |
Value stored to 'dot' is never read | |
188 | len = strlen (filename); |
189 | found = NULL((void*)0); |
190 | max_maj = max_min = 0; |
191 | |
192 | dir = opendir (dirname); |
193 | if (dir == NULL((void*)0)) |
194 | return NULL((void*)0); |
195 | dirnamelen = strlen (dirname); |
196 | |
197 | while ((entry = readdir (dir)) != NULL((void*)0)) |
198 | { |
199 | const char *s; |
200 | char *eptr, *eptr1; |
201 | int found_maj, found_min; |
202 | |
203 | if (strncmp (entry->d_name, "lib", 3) != 0 |
204 | || strncmp (entry->d_name + 3, filename, len) != 0) |
205 | continue; |
206 | |
207 | /* We accept libfoo.so without a version number, even though the |
208 | native linker does not. This is more convenient for packages |
209 | which just generate .so files for shared libraries, as on ELF |
210 | systems. */ |
211 | if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0) |
212 | continue; |
213 | |
214 | if (entry->d_name[6 + len] == '\0') |
215 | ; |
216 | else if (entry->d_name[6 + len] == '.' |
217 | && ISDIGIT ((unsigned char) entry->d_name[7 + len])(_sch_istable[((unsigned char) entry->d_name[7 + len]) & 0xff] & (unsigned short)(_sch_isdigit))) |
218 | ; |
219 | else |
220 | continue; |
221 | |
222 | for (s = entry->d_name + 6 + len; *s != '\0'; s++) |
223 | if (*s != '.' && ! ISDIGIT ((unsigned char) *s)(_sch_istable[((unsigned char) *s) & 0xff] & (unsigned short)(_sch_isdigit))) |
224 | break; |
225 | if (*s != '\0') |
226 | continue; |
227 | |
228 | /* We've found a .so file. Work out the major and minor |
229 | version numbers. */ |
230 | found_maj = -1; |
231 | found_min = -1; |
232 | |
233 | /* do allow libN.so */ |
234 | if (entry->d_name[6 + len] == '.') { |
235 | found_maj = strtoul (entry->d_name + 7 + len, &eptr, 10); |
236 | |
237 | /* do not support libN.so. or libN.so.X */ |
238 | if (*eptr != '.' || ((entry->d_name + 3 + len) == eptr)) |
239 | continue; |
240 | |
241 | found_min = strtoul (eptr+1, &eptr1, 10); |
242 | |
243 | /* do not support libN.so.X. or libN.so.X.Y.[anything] */ |
244 | if (*eptr1 != '\0' || (eptr+1 == eptr1)) |
245 | continue; |
246 | } |
247 | |
248 | /* Make sure the file really exists (ignore broken symlinks). */ |
249 | full_path = xmalloc (dirnamelen + 1 + strlen (entry->d_name) + 1); |
250 | sprintf (full_path, "%s/%s", dirname, entry->d_name); |
251 | statval = stat (full_path, &st); |
252 | free (full_path); |
253 | if (statval != 0) |
254 | continue; |
255 | |
256 | /* We've found a match for the name we are searching for. See |
257 | if this is the version we should use. */ |
258 | if (((req_maj == -1) && (found == NULL((void*)0) |
259 | || (found_maj > max_maj) |
260 | || (found_maj == max_maj && (found_min > max_min)))) |
261 | || ((found_maj == req_maj) && (found_min >= req_min) |
262 | && (found_min > max_min))) |
263 | { |
264 | if (found != NULL((void*)0)) |
265 | free (found); |
266 | found = (char *) xmalloc (dirnamelen + strlen (entry->d_name) + 2); |
267 | sprintf (found, "%s/%s", dirname, entry->d_name); |
268 | max_maj = found_maj; |
269 | max_min = found_min; |
270 | } |
271 | } |
272 | |
273 | closedir (dir); |
274 | |
275 | return found; |
276 | } |
277 | |
278 | |
279 | static void |
280 | gldelf_x86_64_obsd_before_parse (void) |
281 | { |
282 | ldfile_set_output_arch ("i386:x86-64", bfd_arch_i386); |
283 | config.dynamic_link = TRUE1; |
284 | config.has_shared = TRUE1; |
285 | } |
286 | |
287 | /* Handle as_needed DT_NEEDED. */ |
288 | |
289 | static bfd_boolean |
290 | gldelf_x86_64_obsd_load_symbols (lang_input_statement_type *entry) |
291 | { |
292 | int class = 0; |
293 | |
294 | /* Tell the ELF linker that we don't want the output file to have a |
295 | DT_NEEDED entry for this file, unless it is used to resolve |
296 | references in a regular object. */ |
297 | if (entry->as_needed) |
298 | class = DYN_AS_NEEDED; |
299 | |
300 | /* Tell the ELF linker that we don't want the output file to have a |
301 | DT_NEEDED entry for any dynamic library in DT_NEEDED tags from |
302 | this file at all. */ |
303 | if (!entry->add_needed) |
304 | class |= DYN_NO_ADD_NEEDED; |
305 | |
306 | if (entry->just_syms_flag |
307 | && (bfd_get_file_flags (entry->the_bfd)((entry->the_bfd)->flags) & DYNAMIC0x40) != 0) |
308 | einfo (_("%P%F: --just-symbols may not be used on DSO: %B\n")("%P%F: --just-symbols may not be used on DSO: %B\n"), |
309 | entry->the_bfd); |
310 | |
311 | if (!class |
312 | || (bfd_get_file_flags (entry->the_bfd)((entry->the_bfd)->flags) & DYNAMIC0x40) == 0) |
313 | return FALSE0; |
314 | |
315 | bfd_elf_set_dyn_lib_class (entry->the_bfd, class); |
316 | |
317 | /* Continue on with normal load_symbols processing. */ |
318 | return FALSE0; |
319 | } |
320 | |
321 | /* These variables are required to pass information back and forth |
322 | between after_open and check_needed and stat_needed and vercheck. */ |
323 | |
324 | static struct bfd_link_needed_list *global_needed; |
325 | static struct stat global_stat; |
326 | static lang_input_statement_type *global_found; |
327 | static struct bfd_link_needed_list *global_vercheck_needed; |
328 | static bfd_boolean global_vercheck_failed; |
329 | |
330 | |
331 | /* On Linux, it's possible to have different versions of the same |
332 | shared library linked against different versions of libc. The |
333 | dynamic linker somehow tags which libc version to use in |
334 | /etc/ld.so.cache, and, based on the libc that it sees in the |
335 | executable, chooses which version of the shared library to use. |
336 | |
337 | We try to do a similar check here by checking whether this shared |
338 | library needs any other shared libraries which may conflict with |
339 | libraries we have already included in the link. If it does, we |
340 | skip it, and try to find another shared library farther on down the |
341 | link path. |
342 | |
343 | This is called via lang_for_each_input_file. |
344 | GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object |
345 | which we are checking. This sets GLOBAL_VERCHECK_FAILED if we find |
346 | a conflicting version. */ |
347 | |
348 | static void |
349 | gldelf_x86_64_obsd_vercheck (lang_input_statement_type *s) |
350 | { |
351 | const char *soname; |
352 | struct bfd_link_needed_list *l; |
353 | |
354 | if (global_vercheck_failed) |
355 | return; |
356 | if (s->the_bfd == NULL((void*)0) |
357 | || (bfd_get_file_flags (s->the_bfd)((s->the_bfd)->flags) & DYNAMIC0x40) == 0) |
358 | return; |
359 | |
360 | soname = bfd_elf_get_dt_soname (s->the_bfd); |
361 | if (soname == NULL((void*)0)) |
362 | soname = lbasename (bfd_get_filename (s->the_bfd)((char *) (s->the_bfd)->filename)); |
363 | |
364 | for (l = global_vercheck_needed; l != NULL((void*)0); l = l->next) |
365 | { |
366 | const char *suffix; |
367 | |
368 | if (strcmp (soname, l->name) == 0) |
369 | { |
370 | /* Probably can't happen, but it's an easy check. */ |
371 | continue; |
372 | } |
373 | |
374 | if (strchr (l->name, '/') != NULL((void*)0)) |
375 | continue; |
376 | |
377 | suffix = strstr (l->name, ".so."); |
378 | if (suffix == NULL((void*)0)) |
379 | continue; |
380 | |
381 | suffix += sizeof ".so." - 1; |
382 | |
383 | if (strncmp (soname, l->name, suffix - l->name) == 0) |
384 | { |
385 | /* Here we know that S is a dynamic object FOO.SO.VER1, and |
386 | the object we are considering needs a dynamic object |
387 | FOO.SO.VER2, and VER1 and VER2 are different. This |
388 | appears to be a version mismatch, so we tell the caller |
389 | to try a different version of this library. */ |
390 | global_vercheck_failed = TRUE1; |
391 | return; |
392 | } |
393 | } |
394 | } |
395 | |
396 | |
397 | /* See if an input file matches a DT_NEEDED entry by running stat on |
398 | the file. */ |
399 | |
400 | static void |
401 | gldelf_x86_64_obsd_stat_needed (lang_input_statement_type *s) |
402 | { |
403 | struct stat st; |
404 | const char *suffix; |
405 | const char *soname; |
406 | |
407 | if (global_found != NULL((void*)0)) |
408 | return; |
409 | if (s->the_bfd == NULL((void*)0)) |
410 | return; |
411 | |
412 | /* If this input file was an as-needed entry, and wasn't found to be |
413 | needed at the stage it was linked, then don't say we have loaded it. */ |
414 | if ((bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0) |
415 | return; |
416 | |
417 | if (bfd_stat (s->the_bfd, &st) != 0) |
418 | { |
419 | einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd); |
420 | return; |
421 | } |
422 | |
423 | /* Some operating systems, e.g. Windows, do not provide a meaningful |
424 | st_ino; they always set it to zero. (Windows does provide a |
425 | meaningful st_dev.) Do not indicate a duplicate library in that |
426 | case. While there is no guarantee that a system that provides |
427 | meaningful inode numbers will never set st_ino to zero, this is |
428 | merely an optimization, so we do not need to worry about false |
429 | negatives. */ |
430 | if (st.st_dev == global_stat.st_dev |
431 | && st.st_ino == global_stat.st_ino |
432 | && st.st_ino != 0) |
433 | { |
434 | global_found = s; |
435 | return; |
436 | } |
437 | |
438 | /* We issue a warning if it looks like we are including two |
439 | different versions of the same shared library. For example, |
440 | there may be a problem if -lc picks up libc.so.6 but some other |
441 | shared library has a DT_NEEDED entry of libc.so.5. This is a |
442 | heuristic test, and it will only work if the name looks like |
443 | NAME.so.VERSION. FIXME: Depending on file names is error-prone. |
444 | If we really want to issue warnings about mixing version numbers |
445 | of shared libraries, we need to find a better way. */ |
446 | |
447 | if (strchr (global_needed->name, '/') != NULL((void*)0)) |
448 | return; |
449 | suffix = strstr (global_needed->name, ".so."); |
450 | if (suffix == NULL((void*)0)) |
451 | return; |
452 | suffix += sizeof ".so." - 1; |
453 | |
454 | soname = bfd_elf_get_dt_soname (s->the_bfd); |
455 | if (soname == NULL((void*)0)) |
456 | soname = lbasename (s->filename); |
457 | |
458 | if (strncmp (soname, global_needed->name, suffix - global_needed->name) == 0) |
459 | einfo ("%P: warning: %s, needed by %B, may conflict with %s\n", |
460 | global_needed->name, global_needed->by, soname); |
461 | } |
462 | |
463 | struct dt_needed |
464 | { |
465 | bfd *by; |
466 | const char *name; |
467 | }; |
468 | |
469 | /* This function is called for each possible name for a dynamic object |
470 | named by a DT_NEEDED entry. The FORCE parameter indicates whether |
471 | to skip the check for a conflicting version. */ |
472 | |
473 | static bfd_boolean |
474 | gldelf_x86_64_obsd_try_needed (struct dt_needed *needed, |
475 | int force) |
476 | { |
477 | bfd *abfd; |
478 | const char *name = needed->name; |
479 | char *soname; |
480 | int class; |
481 | |
482 | abfd = bfd_openr (name, bfd_get_target (output_bfd)((output_bfd)->xvec->name)); |
483 | if (abfd == NULL((void*)0)) |
484 | return FALSE0; |
485 | if (! bfd_check_format (abfd, bfd_object)) |
486 | { |
487 | bfd_close (abfd); |
488 | return FALSE0; |
489 | } |
490 | if ((bfd_get_file_flags (abfd)((abfd)->flags) & DYNAMIC0x40) == 0) |
491 | { |
492 | bfd_close (abfd); |
493 | return FALSE0; |
494 | } |
495 | |
496 | /* For DT_NEEDED, they have to match. */ |
497 | if (abfd->xvec != output_bfd->xvec) |
498 | { |
499 | bfd_close (abfd); |
500 | return FALSE0; |
501 | } |
502 | |
503 | /* Check whether this object would include any conflicting library |
504 | versions. If FORCE is set, then we skip this check; we use this |
505 | the second time around, if we couldn't find any compatible |
506 | instance of the shared library. */ |
507 | |
508 | if (! force) |
509 | { |
510 | struct bfd_link_needed_list *needed; |
511 | |
512 | if (! bfd_elf_get_bfd_needed_list (abfd, &needed)) |
513 | einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd); |
514 | |
515 | if (needed != NULL((void*)0)) |
516 | { |
517 | global_vercheck_needed = needed; |
518 | global_vercheck_failed = FALSE0; |
519 | lang_for_each_input_file (gldelf_x86_64_obsd_vercheck); |
520 | if (global_vercheck_failed) |
521 | { |
522 | bfd_close (abfd); |
523 | /* Return FALSE to force the caller to move on to try |
524 | another file on the search path. */ |
525 | return FALSE0; |
526 | } |
527 | |
528 | /* But wait! It gets much worse. On Linux, if a shared |
529 | library does not use libc at all, we are supposed to skip |
530 | it the first time around in case we encounter a shared |
531 | library later on with the same name which does use the |
532 | version of libc that we want. This is much too horrible |
533 | to use on any system other than Linux. */ |
534 | |
535 | } |
536 | } |
537 | |
538 | /* We've found a dynamic object matching the DT_NEEDED entry. */ |
539 | |
540 | /* We have already checked that there is no other input file of the |
541 | same name. We must now check again that we are not including the |
542 | same file twice. We need to do this because on many systems |
543 | libc.so is a symlink to, e.g., libc.so.1. The SONAME entry will |
544 | reference libc.so.1. If we have already included libc.so, we |
545 | don't want to include libc.so.1 if they are the same file, and we |
546 | can only check that using stat. */ |
547 | |
548 | if (bfd_stat (abfd, &global_stat) != 0) |
549 | einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd); |
550 | |
551 | /* First strip off everything before the last '/'. */ |
552 | soname = xstrdup (lbasename (abfd->filename)); |
553 | |
554 | if (trace_file_tries) |
555 | info_msg (_("found %s at %s\n")("found %s at %s\n"), soname, name); |
556 | |
557 | global_found = NULL((void*)0); |
558 | lang_for_each_input_file (gldelf_x86_64_obsd_stat_needed); |
559 | if (global_found != NULL((void*)0)) |
560 | { |
561 | /* Return TRUE to indicate that we found the file, even though |
562 | we aren't going to do anything with it. */ |
563 | free (soname); |
564 | return TRUE1; |
565 | } |
566 | |
567 | /* Specify the soname to use. */ |
568 | bfd_elf_set_dt_needed_name (abfd, soname); |
569 | |
570 | /* Tell the ELF linker that we don't want the output file to have a |
571 | DT_NEEDED entry for this file, unless it is used to resolve |
572 | references in a regular object. */ |
573 | class = DYN_DT_NEEDED; |
574 | |
575 | /* Tell the ELF linker that we don't want the output file to have a |
576 | DT_NEEDED entry for this file at all if the entry is from a file |
577 | with DYN_NO_ADD_NEEDED. */ |
578 | if (needed->by != NULL((void*)0) |
579 | && (bfd_elf_get_dyn_lib_class (needed->by) & DYN_NO_ADD_NEEDED) != 0) |
580 | class |= DYN_NO_NEEDED | DYN_NO_ADD_NEEDED; |
581 | |
582 | bfd_elf_set_dyn_lib_class (abfd, class); |
583 | |
584 | /* Add this file into the symbol table. */ |
585 | if (! bfd_link_add_symbols (abfd, &link_info)((*((abfd)->xvec->_bfd_link_add_symbols)) (abfd, &link_info ))) |
586 | einfo ("%F%B: could not read symbols: %E\n", abfd); |
587 | |
588 | return TRUE1; |
589 | } |
590 | |
591 | |
592 | /* Search for a needed file in a path. */ |
593 | |
594 | static bfd_boolean |
595 | gldelf_x86_64_obsd_search_needed (const char *path, |
596 | struct dt_needed *n, int force) |
597 | { |
598 | const char *s; |
599 | const char *name = n->name; |
600 | size_t len; |
601 | struct dt_needed needed; |
602 | |
603 | if (name[0] == '/') |
604 | return gldelf_x86_64_obsd_try_needed (n, force); |
605 | |
606 | if (path == NULL((void*)0) || *path == '\0') |
607 | return FALSE0; |
608 | |
609 | needed.by = n->by; |
610 | |
611 | { |
612 | char *found; |
613 | if ((found = gldelf_x86_64_obsd_search_dir_needed(path, name)) != NULL((void*)0)) { |
614 | needed.name = found; |
615 | if (gldelf_x86_64_obsd_try_needed (&needed, force)) { |
616 | return TRUE1; |
617 | } |
618 | free(found); |
619 | } |
620 | } |
621 | |
622 | needed.name = n->name; |
623 | |
624 | len = strlen (name); |
625 | while (1) |
626 | { |
627 | char *filename, *sset; |
628 | |
629 | s = strchr (path, ':'); |
630 | if (s == NULL((void*)0)) |
631 | s = path + strlen (path); |
632 | |
633 | filename = (char *) xmalloc (s - path + len + 2); |
634 | if (s == path) |
635 | sset = filename; |
636 | else |
637 | { |
638 | memcpy (filename, path, s - path); |
639 | filename[s - path] = '/'; |
640 | sset = filename + (s - path) + 1; |
641 | } |
642 | strcpy (sset, name); |
643 | |
644 | needed.name = filename; |
645 | if (gldelf_x86_64_obsd_try_needed (&needed, force)) |
646 | return TRUE1; |
647 | |
648 | free (filename); |
649 | |
650 | if (*s == '\0') |
651 | break; |
652 | path = s + 1; |
653 | } |
654 | |
655 | return FALSE0; |
656 | } |
657 | |
658 | |
659 | /* Add the sysroot to every entry in a colon-separated path. */ |
660 | |
661 | static char * |
662 | gldelf_x86_64_obsd_add_sysroot (const char *path) |
663 | { |
664 | int len, colons, i; |
665 | char *ret, *p; |
666 | |
667 | len = strlen (path); |
668 | colons = 0; |
669 | i = 0; |
670 | while (path[i]) |
671 | if (path[i++] == ':') |
672 | colons++; |
673 | |
674 | if (path[i]) |
675 | colons++; |
676 | |
677 | len = len + (colons + 1) * strlen (ld_sysroot); |
678 | ret = xmalloc (len + 1); |
679 | strcpy (ret, ld_sysroot); |
680 | p = ret + strlen (ret); |
681 | i = 0; |
682 | while (path[i]) |
683 | if (path[i] == ':') |
684 | { |
685 | *p++ = path[i++]; |
686 | strcpy (p, ld_sysroot); |
687 | p = p + strlen (p); |
688 | } |
689 | else |
690 | *p++ = path[i++]; |
691 | |
692 | *p = 0; |
693 | return ret; |
694 | } |
695 | |
696 | |
697 | /* See if an input file matches a DT_NEEDED entry by name. */ |
698 | |
699 | static void |
700 | gldelf_x86_64_obsd_check_needed (lang_input_statement_type *s) |
701 | { |
702 | const char *soname; |
703 | |
704 | /* Stop looking if we've found a loaded lib. */ |
705 | if (global_found != NULL((void*)0) |
706 | && (bfd_elf_get_dyn_lib_class (global_found->the_bfd) |
707 | & DYN_AS_NEEDED) == 0) |
708 | return; |
709 | |
710 | if (s->filename == NULL((void*)0) || s->the_bfd == NULL((void*)0)) |
711 | return; |
712 | |
713 | /* Don't look for a second non-loaded as-needed lib. */ |
714 | if (global_found != NULL((void*)0) |
715 | && (bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0) |
716 | return; |
717 | |
718 | if (strcmp (s->filename, global_needed->name) == 0) |
719 | { |
720 | global_found = s; |
721 | return; |
722 | } |
723 | |
724 | if (s->search_dirs_flag) |
725 | { |
726 | const char *f = strrchr (s->filename, '/'); |
727 | if (f != NULL((void*)0) |
728 | && strcmp (f + 1, global_needed->name) == 0) |
729 | { |
730 | global_found = s; |
731 | return; |
732 | } |
733 | } |
734 | |
735 | soname = bfd_elf_get_dt_soname (s->the_bfd); |
736 | if (soname != NULL((void*)0) |
737 | && strcmp (soname, global_needed->name) == 0) |
738 | { |
739 | global_found = s; |
740 | return; |
741 | } |
742 | } |
743 | |
744 | |
745 | static void |
746 | gldelf_x86_64_obsd_force_readonly(lang_input_statement_type *s) |
747 | { |
748 | asection *sec; |
749 | |
750 | if (s->the_bfd == NULL((void*)0)) |
751 | return; |
752 | |
753 | sec = bfd_get_section_by_name (s->the_bfd, ".ctors"); |
754 | if (sec) |
755 | sec->flags |= SEC_READONLY0x008; |
756 | sec = bfd_get_section_by_name (s->the_bfd, ".dtors"); |
757 | if (sec) |
758 | sec->flags |= SEC_READONLY0x008; |
759 | } |
760 | |
761 | /* This is called after all the input files have been opened. */ |
762 | |
763 | static void |
764 | gldelf_x86_64_obsd_after_open (void) |
765 | { |
766 | struct bfd_link_needed_list *needed, *l; |
767 | |
768 | /* We only need to worry about this when doing a final link. */ |
769 | if (link_info.relocatable || !link_info.executable) |
770 | return; |
771 | |
772 | /* If we don't have a .dynamic section, we have no relocations, and |
773 | we can make .got, .ctors and .dtors read-only. This will make |
774 | the segment containing those sections to be read-only in static |
775 | executables. */ |
776 | if (link_info.hash->type == bfd_link_elf_hash_table |
777 | && !elf_hash_table (&link_info)((struct elf_link_hash_table *) ((&link_info)->hash))->dynamic_sections_created) |
778 | { |
779 | bfd *dynobj = elf_hash_table (&link_info)((struct elf_link_hash_table *) ((&link_info)->hash))->dynobj; |
780 | |
781 | if (dynobj != NULL((void*)0)) |
782 | { |
783 | asection *sec; |
784 | |
785 | sec = bfd_get_section_by_name (dynobj, ".got"); |
786 | if (sec) |
787 | sec->flags |= SEC_READONLY0x008; |
788 | } |
789 | |
790 | lang_for_each_input_file (gldelf_x86_64_obsd_force_readonly); |
791 | } |
792 | |
793 | /* Get the list of files which appear in DT_NEEDED entries in |
794 | dynamic objects included in the link (often there will be none). |
795 | For each such file, we want to track down the corresponding |
796 | library, and include the symbol table in the link. This is what |
797 | the runtime dynamic linker will do. Tracking the files down here |
798 | permits one dynamic object to include another without requiring |
799 | special action by the person doing the link. Note that the |
800 | needed list can actually grow while we are stepping through this |
801 | loop. */ |
802 | needed = bfd_elf_get_needed_list (output_bfd, &link_info); |
803 | for (l = needed; l != NULL((void*)0); l = l->next) |
804 | { |
805 | struct bfd_link_needed_list *ll; |
806 | struct dt_needed n, nn; |
807 | int force; |
808 | |
809 | /* If the lib that needs this one was --as-needed and wasn't |
810 | found to be needed, then this lib isn't needed either. */ |
811 | if (l->by != NULL((void*)0) |
812 | && (bfd_elf_get_dyn_lib_class (l->by) & DYN_AS_NEEDED) != 0) |
813 | continue; |
814 | |
815 | /* If we've already seen this file, skip it. */ |
816 | for (ll = needed; ll != l; ll = ll->next) |
817 | if ((ll->by == NULL((void*)0) |
818 | || (bfd_elf_get_dyn_lib_class (ll->by) & DYN_AS_NEEDED) == 0) |
819 | && strcmp (ll->name, l->name) == 0) |
820 | break; |
821 | if (ll != l) |
822 | continue; |
823 | |
824 | /* See if this file was included in the link explicitly. */ |
825 | global_needed = l; |
826 | global_found = NULL((void*)0); |
827 | lang_for_each_input_file (gldelf_x86_64_obsd_check_needed); |
828 | if (global_found != NULL((void*)0) |
829 | && (bfd_elf_get_dyn_lib_class (global_found->the_bfd) |
830 | & DYN_AS_NEEDED) == 0) |
831 | continue; |
832 | |
833 | n.by = l->by; |
834 | n.name = l->name; |
835 | nn.by = l->by; |
836 | if (trace_file_tries) |
837 | info_msg (_("%s needed by %B\n")("%s needed by %B\n"), l->name, l->by); |
838 | |
839 | /* As-needed libs specified on the command line (or linker script) |
840 | take priority over libs found in search dirs. */ |
841 | if (global_found != NULL((void*)0)) |
842 | { |
843 | nn.name = global_found->filename; |
844 | if (gldelf_x86_64_obsd_try_needed (&nn, TRUE1)) |
845 | continue; |
846 | } |
847 | |
848 | /* We need to find this file and include the symbol table. We |
849 | want to search for the file in the same way that the dynamic |
850 | linker will search. That means that we want to use |
851 | rpath_link, rpath, then the environment variable |
852 | LD_LIBRARY_PATH (native only), then the DT_RPATH/DT_RUNPATH |
853 | entries (native only), then the linker script LIB_SEARCH_DIRS. |
854 | We look at the -L arguments to build the search path. |
855 | |
856 | We search twice. The first time, we skip objects which may |
857 | introduce version mismatches. The second time, we force |
858 | their use. See gldelf_x86_64_obsd_vercheck comment. */ |
859 | for (force = 0; force < 2; force++) |
860 | { |
861 | size_t len; |
862 | search_dirs_type *search; |
863 | char *lib_path; |
864 | struct bfd_link_needed_list *rp; |
865 | int found; |
866 | |
867 | if (gldelf_x86_64_obsd_search_needed (command_line.rpath_link, |
868 | &n, force)) |
869 | break; |
870 | if (gldelf_x86_64_obsd_search_needed (command_line.rpath, |
871 | &n, force)) |
872 | break; |
873 | if (getenv ("LD_RUN_PATH") != NULL((void*)0) |
874 | && command_line.rpath_link == NULL((void*)0) |
875 | && command_line.rpath == NULL((void*)0)) |
876 | { |
877 | lib_path = getenv ("LD_RUN_PATH"); |
878 | if (gldelf_x86_64_obsd_search_needed (lib_path, &n, force)) |
879 | break; |
880 | } |
881 | |
882 | len = strlen(search_head->name); |
883 | lib_path = xstrdup(search_head->name); |
884 | for (search = search_head->next; search != NULL((void*)0); |
885 | search = search->next) |
886 | { |
887 | size_t nlen; |
888 | |
889 | nlen = strlen(search->name); |
890 | lib_path = xrealloc(lib_path, len + nlen + 2); |
891 | lib_path[len] = ':'; |
892 | strcpy(lib_path + len + 1, search->name); |
893 | len += nlen + 1; |
894 | } |
895 | |
896 | if (gldelf_x86_64_obsd_search_needed (lib_path, &n, force)) |
897 | { |
898 | free (lib_path); |
899 | break; |
900 | } |
901 | free (lib_path); |
902 | |
903 | lib_path = getenv ("LD_LIBRARY_PATH"); |
904 | if (gldelf_x86_64_obsd_search_needed (lib_path, &n, force)) |
905 | break; |
906 | found = 0; |
907 | rp = bfd_elf_get_runpath_list (output_bfd, &link_info); |
908 | for (; !found && rp != NULL((void*)0); rp = rp->next) |
909 | { |
910 | char *tmpname = gldelf_x86_64_obsd_add_sysroot (rp->name); |
911 | found = (rp->by == l->by |
912 | && gldelf_x86_64_obsd_search_needed (tmpname, |
913 | &n, |
914 | force)); |
915 | free (tmpname); |
916 | } |
917 | if (found) |
918 | break; |
919 | |
920 | len = strlen (l->name); |
921 | for (search = search_head; search != NULL((void*)0); search = search->next) |
922 | { |
923 | char *filename; |
924 | |
925 | if (search->cmdline) |
926 | continue; |
927 | filename = (char *) xmalloc (strlen (search->name) + len + 2); |
928 | sprintf (filename, "%s/%s", search->name, l->name); |
929 | nn.name = filename; |
930 | if (gldelf_x86_64_obsd_try_needed (&nn, force)) |
931 | break; |
932 | free (filename); |
933 | } |
934 | if (search != NULL((void*)0)) |
935 | break; |
936 | } |
937 | |
938 | if (force < 2) |
939 | continue; |
940 | |
941 | einfo ("%P: warning: %s, needed by %B, not found (try using -rpath or -rpath-link)\n", |
942 | l->name, l->by); |
943 | } |
944 | } |
945 | |
946 | |
947 | /* Look through an expression for an assignment statement. */ |
948 | |
949 | static void |
950 | gldelf_x86_64_obsd_find_exp_assignment (etree_type *exp) |
951 | { |
952 | bfd_boolean provide = FALSE0; |
953 | |
954 | switch (exp->type.node_class) |
955 | { |
956 | case etree_provide: |
957 | provide = TRUE1; |
958 | /* Fall thru */ |
959 | case etree_assign: |
960 | /* We call record_link_assignment even if the symbol is defined. |
961 | This is because if it is defined by a dynamic object, we |
962 | actually want to use the value defined by the linker script, |
963 | not the value from the dynamic object (because we are setting |
964 | symbols like etext). If the symbol is defined by a regular |
965 | object, then, as it happens, calling record_link_assignment |
966 | will do no harm. */ |
967 | if (strcmp (exp->assign.dst, ".") != 0) |
968 | { |
969 | if (!bfd_elf_record_link_assignment (output_bfd, &link_info, |
970 | exp->assign.dst, provide, |
971 | exp->assign.hidden)) |
972 | einfo ("%P%F: failed to record assignment to %s: %E\n", |
973 | exp->assign.dst); |
974 | } |
975 | gldelf_x86_64_obsd_find_exp_assignment (exp->assign.src); |
976 | break; |
977 | |
978 | case etree_binary: |
979 | gldelf_x86_64_obsd_find_exp_assignment (exp->binary.lhs); |
980 | gldelf_x86_64_obsd_find_exp_assignment (exp->binary.rhs); |
981 | break; |
982 | |
983 | case etree_trinary: |
984 | gldelf_x86_64_obsd_find_exp_assignment (exp->trinary.cond); |
985 | gldelf_x86_64_obsd_find_exp_assignment (exp->trinary.lhs); |
986 | gldelf_x86_64_obsd_find_exp_assignment (exp->trinary.rhs); |
987 | break; |
988 | |
989 | case etree_unary: |
990 | gldelf_x86_64_obsd_find_exp_assignment (exp->unary.child); |
991 | break; |
992 | |
993 | default: |
994 | break; |
995 | } |
996 | } |
997 | |
998 | |
999 | /* This is called by the before_allocation routine via |
1000 | lang_for_each_statement. It locates any assignment statements, and |
1001 | tells the ELF backend about them, in case they are assignments to |
1002 | symbols which are referred to by dynamic objects. */ |
1003 | |
1004 | static void |
1005 | gldelf_x86_64_obsd_find_statement_assignment (lang_statement_union_type *s) |
1006 | { |
1007 | if (s->header.type == lang_assignment_statement_enum) |
1008 | gldelf_x86_64_obsd_find_exp_assignment (s->assignment_statement.exp); |
1009 | } |
1010 | |
1011 | |
1012 | /* This is called after the sections have been attached to output |
1013 | sections, but before any sizes or addresses have been set. */ |
1014 | |
1015 | static void |
1016 | gldelf_x86_64_obsd_before_allocation (void) |
1017 | { |
1018 | const char *rpath; |
1019 | asection *sinterp; |
1020 | |
1021 | if (link_info.hash->type == bfd_link_elf_hash_table) |
1022 | _bfd_elf_tls_setup (output_bfd, &link_info); |
1023 | |
1024 | /* If we are going to make any variable assignments, we need to let |
1025 | the ELF backend know about them in case the variables are |
1026 | referred to by dynamic objects. */ |
1027 | lang_for_each_statement (gldelf_x86_64_obsd_find_statement_assignment); |
1028 | |
1029 | /* Let the ELF backend work out the sizes of any sections required |
1030 | by dynamic linking. */ |
1031 | rpath = command_line.rpath; |
1032 | if (rpath == NULL((void*)0)) |
1033 | rpath = (const char *) getenv ("LD_RUN_PATH"); |
1034 | if (! (bfd_elf_size_dynamic_sections |
1035 | (output_bfd, command_line.soname, rpath, |
1036 | command_line.filter_shlib, |
1037 | (const char * const *) command_line.auxiliary_filters, |
1038 | &link_info, &sinterp, lang_elf_version_info))) |
1039 | einfo ("%P%F: failed to set dynamic section sizes: %E\n"); |
1040 | |
1041 | |
1042 | /* Let the user override the dynamic linker we are using. */ |
1043 | if (command_line.interpreter != NULL((void*)0) |
1044 | && sinterp != NULL((void*)0)) |
1045 | { |
1046 | sinterp->contents = (bfd_byte *) command_line.interpreter; |
1047 | sinterp->size = strlen (command_line.interpreter) + 1; |
1048 | } |
1049 | |
1050 | /* Look for any sections named .gnu.warning. As a GNU extensions, |
1051 | we treat such sections as containing warning messages. We print |
1052 | out the warning message, and then zero out the section size so |
1053 | that it does not get copied into the output file. */ |
1054 | |
1055 | { |
1056 | LANG_FOR_EACH_INPUT_STATEMENT (is)lang_input_statement_type *is; for (is = (lang_input_statement_type *) file_chain.head; is != (lang_input_statement_type *) ((void *)0); is = (lang_input_statement_type *) is->next) |
1057 | { |
1058 | asection *s; |
1059 | bfd_size_type sz; |
1060 | char *msg; |
1061 | bfd_boolean ret; |
1062 | |
1063 | if (is->just_syms_flag) |
1064 | continue; |
1065 | |
1066 | s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning"); |
1067 | if (s == NULL((void*)0)) |
1068 | continue; |
1069 | |
1070 | sz = s->size; |
1071 | msg = xmalloc ((size_t) (sz + 1)); |
1072 | if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz)) |
1073 | einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n", |
1074 | is->the_bfd); |
1075 | msg[sz] = '\0'; |
1076 | ret = link_info.callbacks->warning (&link_info, msg, |
1077 | (const char *) NULL((void*)0), |
1078 | is->the_bfd, (asection *) NULL((void*)0), |
1079 | (bfd_vma) 0); |
1080 | ASSERT (ret)do { if (!(ret)) info_assert("eelf_x86_64_obsd.c",1080); } while (0); |
1081 | free (msg); |
1082 | |
1083 | /* Clobber the section size, so that we don't waste copying the |
1084 | warning into the output file. */ |
1085 | s->size = 0; |
1086 | |
1087 | /* Also set SEC_EXCLUDE, so that symbols defined in the warning |
1088 | section don't get copied to the output. */ |
1089 | s->flags |= SEC_EXCLUDE0x8000; |
1090 | } |
1091 | } |
1092 | |
1093 | before_allocation_default (); |
1094 | |
1095 | if (!bfd_elf_size_dynsym_hash_dynstr (output_bfd, &link_info)) |
1096 | einfo ("%P%F: failed to set dynamic section sizes: %E\n"); |
1097 | } |
1098 | |
1099 | |
1100 | /* Try to open a dynamic archive. This is where we know that ELF |
1101 | dynamic libraries have an extension of .so (or .sl on oddball systems |
1102 | like hpux). */ |
1103 | |
1104 | static bfd_boolean |
1105 | gldelf_x86_64_obsd_open_dynamic_archive |
1106 | (const char *arch __unused__attribute__((__unused__)), search_dirs_type *search, |
1107 | lang_input_statement_type *entry) |
1108 | { |
1109 | const char *filename; |
1110 | char *string; |
1111 | |
1112 | if (! entry->is_archive) |
1113 | return FALSE0; |
1114 | |
1115 | filename = entry->filename; |
1116 | |
1117 | string = gldelf_x86_64_obsd_search_dir(search->name, filename, -1, -1); |
1118 | if (string == NULL((void*)0)) |
1119 | return FALSE0; |
1120 | #ifdef EXTRA_SHLIB_EXTENSION |
1121 | /* Try the .so extension first. If that fails build a new filename |
1122 | using EXTRA_SHLIB_EXTENSION. */ |
1123 | if (! ldfile_try_open_bfd (string, entry)) |
1124 | sprintf (string, "%s/lib%s%s%s", search->name, |
1125 | filename, arch, EXTRA_SHLIB_EXTENSION); |
1126 | #endif |
1127 | |
1128 | if (! ldfile_try_open_bfd (string, entry)) |
1129 | { |
1130 | free (string); |
1131 | return FALSE0; |
1132 | } |
1133 | |
1134 | entry->filename = string; |
1135 | |
1136 | /* We have found a dynamic object to include in the link. The ELF |
1137 | backend linker will create a DT_NEEDED entry in the .dynamic |
1138 | section naming this file. If this file includes a DT_SONAME |
1139 | entry, it will be used. Otherwise, the ELF linker will just use |
1140 | the name of the file. For an archive found by searching, like |
1141 | this one, the DT_NEEDED entry should consist of just the name of |
1142 | the file, without the path information used to find it. Note |
1143 | that we only need to do this if we have a dynamic object; an |
1144 | archive will never be referenced by a DT_NEEDED entry. |
1145 | |
1146 | FIXME: This approach--using bfd_elf_set_dt_needed_name--is not |
1147 | very pretty. I haven't been able to think of anything that is |
1148 | pretty, though. */ |
1149 | if (bfd_check_format (entry->the_bfd, bfd_object) |
1150 | && (entry->the_bfd->flags & DYNAMIC0x40) != 0) |
1151 | { |
1152 | ASSERT (entry->is_archive && entry->search_dirs_flag)do { if (!(entry->is_archive && entry->search_dirs_flag )) info_assert("eelf_x86_64_obsd.c",1152); } while (0); |
1153 | |
1154 | /* Rather than duplicating the logic above. Just use the |
1155 | filename we recorded earlier. */ |
1156 | |
1157 | filename = lbasename (entry->filename); |
1158 | bfd_elf_set_dt_needed_name (entry->the_bfd, filename); |
1159 | } |
1160 | |
1161 | return TRUE1; |
1162 | } |
1163 | |
1164 | |
1165 | /* A variant of lang_output_section_find used by place_orphan. */ |
1166 | |
1167 | static lang_output_section_statement_type * |
1168 | output_rel_find (asection *sec, int isdyn) |
1169 | { |
1170 | lang_output_section_statement_type *lookup; |
1171 | lang_output_section_statement_type *last = NULL((void*)0); |
1172 | lang_output_section_statement_type *last_alloc = NULL((void*)0); |
1173 | lang_output_section_statement_type *last_rel = NULL((void*)0); |
1174 | lang_output_section_statement_type *last_rel_alloc = NULL((void*)0); |
1175 | int rela = sec->name[4] == 'a'; |
1176 | |
1177 | for (lookup = &lang_output_section_statement.head->output_section_statement; |
1178 | lookup != NULL((void*)0); |
1179 | lookup = lookup->next) |
1180 | { |
1181 | if (lookup->constraint != -1 |
1182 | && strncmp (".rel", lookup->name, 4) == 0) |
1183 | { |
1184 | int lookrela = lookup->name[4] == 'a'; |
1185 | |
1186 | /* .rel.dyn must come before all other reloc sections, to suit |
1187 | GNU ld.so. */ |
1188 | if (isdyn) |
1189 | break; |
1190 | |
1191 | /* Don't place after .rel.plt as doing so results in wrong |
1192 | dynamic tags. */ |
1193 | if (strcmp (".plt", lookup->name + 4 + lookrela) == 0) |
1194 | break; |
1195 | |
1196 | if (rela == lookrela || last_rel == NULL((void*)0)) |
1197 | last_rel = lookup; |
1198 | if ((rela == lookrela || last_rel_alloc == NULL((void*)0)) |
1199 | && lookup->bfd_section != NULL((void*)0) |
1200 | && (lookup->bfd_section->flags & SEC_ALLOC0x001) != 0) |
1201 | last_rel_alloc = lookup; |
1202 | } |
1203 | |
1204 | last = lookup; |
1205 | if (lookup->bfd_section != NULL((void*)0) |
1206 | && (lookup->bfd_section->flags & SEC_ALLOC0x001) != 0) |
1207 | last_alloc = lookup; |
1208 | } |
1209 | |
1210 | if (last_rel_alloc) |
1211 | return last_rel_alloc; |
1212 | |
1213 | if (last_rel) |
1214 | return last_rel; |
1215 | |
1216 | if (last_alloc) |
1217 | return last_alloc; |
1218 | |
1219 | return last; |
1220 | } |
1221 | |
1222 | /* Place an orphan section. We use this to put random SHF_ALLOC |
1223 | sections in the right segment. */ |
1224 | |
1225 | static bfd_boolean |
1226 | gldelf_x86_64_obsd_place_orphan (asection *s) |
1227 | { |
1228 | static struct orphan_save hold[] = |
1229 | { |
1230 | { ".text", |
1231 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_READONLY0x008 | SEC_CODE0x010, |
1232 | 0, 0, 0, 0 }, |
1233 | { ".rodata", |
1234 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_READONLY0x008 | SEC_DATA0x020, |
1235 | 0, 0, 0, 0 }, |
1236 | { ".data", |
1237 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_DATA0x020, |
1238 | 0, 0, 0, 0 }, |
1239 | { ".bss", |
1240 | SEC_ALLOC0x001, |
1241 | 0, 0, 0, 0 }, |
1242 | { 0, |
1243 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_READONLY0x008 | SEC_DATA0x020, |
1244 | 0, 0, 0, 0 }, |
1245 | { ".interp", |
1246 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_READONLY0x008 | SEC_DATA0x020, |
1247 | 0, 0, 0, 0 }, |
1248 | { ".sdata", |
1249 | SEC_HAS_CONTENTS0x100 | SEC_ALLOC0x001 | SEC_LOAD0x002 | SEC_DATA0x020 | SEC_SMALL_DATA0x800000, |
1250 | 0, 0, 0, 0 } |
1251 | }; |
1252 | enum orphan_save_index |
1253 | { |
1254 | orphan_text = 0, |
1255 | orphan_rodata, |
1256 | orphan_data, |
1257 | orphan_bss, |
1258 | orphan_rel, |
1259 | orphan_interp, |
1260 | orphan_sdata |
1261 | }; |
1262 | static int orphan_init_done = 0; |
1263 | struct orphan_save *place; |
1264 | const char *secname; |
1265 | lang_output_section_statement_type *after; |
1266 | lang_output_section_statement_type *os; |
1267 | int isdyn = 0; |
1268 | int iself = s->owner->xvec->flavour == bfd_target_elf_flavour; |
1269 | unsigned int sh_type = iself ? elf_section_type (s)(((struct bfd_elf_section_data*)(s)->used_by_bfd)->this_hdr .sh_type) : SHT_NULL0; |
1270 | |
1271 | secname = bfd_get_section_name (s->owner, s)((s)->name + 0); |
1272 | |
1273 | if (! link_info.relocatable |
1274 | && link_info.combreloc |
1275 | && (s->flags & SEC_ALLOC0x001)) |
1276 | { |
1277 | if (iself) |
1278 | switch (sh_type) |
1279 | { |
1280 | case SHT_RELA4: |
1281 | secname = ".rela.dyn"; |
1282 | isdyn = 1; |
1283 | break; |
1284 | case SHT_REL9: |
1285 | secname = ".rel.dyn"; |
1286 | isdyn = 1; |
1287 | break; |
1288 | default: |
1289 | break; |
1290 | } |
1291 | else if (strncmp (secname, ".rel", 4) == 0) |
1292 | { |
1293 | secname = secname[4] == 'a' ? ".rela.dyn" : ".rel.dyn"; |
1294 | isdyn = 1; |
1295 | } |
1296 | } |
1297 | |
1298 | if (isdyn || (!config.unique_orphan_sections && !unique_section_p (s))) |
1299 | { |
1300 | /* Look through the script to see where to place this section. */ |
1301 | os = lang_output_section_find (secname); |
1302 | |
1303 | if (os != NULL((void*)0) |
1304 | && (os->bfd_section == NULL((void*)0) |
1305 | || os->bfd_section->flags == 0 |
1306 | || (_bfd_elf_match_sections_by_type (output_bfd, |
1307 | os->bfd_section, |
1308 | s->owner, s) |
1309 | && ((s->flags ^ os->bfd_section->flags) |
1310 | & (SEC_LOAD0x002 | SEC_ALLOC0x001)) == 0))) |
1311 | { |
1312 | /* We already have an output section statement with this |
1313 | name, and its bfd section, if any, has compatible flags. |
1314 | If the section already exists but does not have any flags |
1315 | set, then it has been created by the linker, probably as a |
1316 | result of a --section-start command line switch. */ |
1317 | lang_add_section (&os->children, s, os); |
1318 | return TRUE1; |
1319 | } |
1320 | } |
1321 | |
1322 | if (!orphan_init_done) |
1323 | { |
1324 | struct orphan_save *ho; |
1325 | for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho) |
1326 | if (ho->name != NULL((void*)0)) |
1327 | { |
1328 | ho->os = lang_output_section_find (ho->name); |
1329 | if (ho->os != NULL((void*)0) && ho->os->flags == 0) |
1330 | ho->os->flags = ho->flags; |
1331 | } |
1332 | orphan_init_done = 1; |
1333 | } |
1334 | |
1335 | /* If this is a final link, then always put .gnu.warning.SYMBOL |
1336 | sections into the .text section to get them out of the way. */ |
1337 | if (link_info.executable |
1338 | && ! link_info.relocatable |
1339 | && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 |
1340 | && hold[orphan_text].os != NULL((void*)0)) |
1341 | { |
1342 | lang_add_section (&hold[orphan_text].os->children, s, |
1343 | hold[orphan_text].os); |
1344 | return TRUE1; |
1345 | } |
1346 | |
1347 | /* Decide which segment the section should go in based on the |
1348 | section name and section flags. We put loadable .note sections |
1349 | right after the .interp section, so that the PT_NOTE segment is |
1350 | stored right after the program headers where the OS can read it |
1351 | in the first page. */ |
1352 | |
1353 | place = NULL((void*)0); |
1354 | if ((s->flags & SEC_ALLOC0x001) == 0) |
1355 | ; |
1356 | else if ((s->flags & SEC_LOAD0x002) != 0 |
1357 | && ((iself && sh_type == SHT_NOTE7) |
1358 | || (!iself && strncmp (secname, ".note", 5) == 0))) |
1359 | place = &hold[orphan_interp]; |
1360 | else if ((s->flags & (SEC_LOAD0x002 | SEC_HAS_CONTENTS0x100)) == 0) |
1361 | place = &hold[orphan_bss]; |
1362 | else if ((s->flags & SEC_SMALL_DATA0x800000) != 0) |
1363 | place = &hold[orphan_sdata]; |
1364 | else if ((s->flags & SEC_READONLY0x008) == 0) |
1365 | place = &hold[orphan_data]; |
1366 | else if (((iself && (sh_type == SHT_RELA4 || sh_type == SHT_REL9)) |
1367 | || (!iself && strncmp (secname, ".rel", 4) == 0)) |
1368 | && (s->flags & SEC_LOAD0x002) != 0) |
1369 | place = &hold[orphan_rel]; |
1370 | else if ((s->flags & SEC_CODE0x010) == 0) |
1371 | place = &hold[orphan_rodata]; |
1372 | else |
1373 | place = &hold[orphan_text]; |
1374 | |
1375 | after = NULL((void*)0); |
1376 | if (place != NULL((void*)0)) |
1377 | { |
1378 | if (place->os == NULL((void*)0)) |
1379 | { |
1380 | if (place->name != NULL((void*)0)) |
1381 | place->os = lang_output_section_find (place->name); |
1382 | else |
1383 | place->os = output_rel_find (s, isdyn); |
1384 | } |
1385 | after = place->os; |
1386 | if (after == NULL((void*)0)) |
1387 | after = lang_output_section_find_by_flags |
1388 | (s, &place->os, _bfd_elf_match_sections_by_type); |
1389 | if (after == NULL((void*)0)) |
1390 | /* *ABS* is always the first output section statement. */ |
1391 | after = &lang_output_section_statement.head->output_section_statement; |
1392 | } |
1393 | |
1394 | /* Choose a unique name for the section. This will be needed if the |
1395 | same section name appears in the input file with different |
1396 | loadable or allocatable characteristics. */ |
1397 | if (bfd_get_section_by_name (output_bfd, secname) != NULL((void*)0)) |
1398 | { |
1399 | static int count = 1; |
1400 | secname = bfd_get_unique_section_name (output_bfd, secname, &count); |
1401 | if (secname == NULL((void*)0)) |
1402 | einfo ("%F%P: place_orphan failed: %E\n"); |
1403 | } |
1404 | |
1405 | lang_insert_orphan (s, secname, after, place, NULL((void*)0), NULL((void*)0)); |
1406 | |
1407 | return TRUE1; |
1408 | } |
1409 | |
1410 | static void |
1411 | gldelf_x86_64_obsd_layout_sections_again (void) |
1412 | { |
1413 | lang_reset_memory_regions (); |
1414 | |
1415 | /* Resize the sections. */ |
1416 | lang_size_sections (NULL((void*)0), TRUE1); |
1417 | |
1418 | /* Redo special stuff. */ |
1419 | ldemul_after_allocation (); |
1420 | |
1421 | /* Do the assignments again. */ |
1422 | lang_do_assignments (); |
1423 | } |
1424 | |
1425 | static void |
1426 | gldelf_x86_64_obsd_finish (void) |
1427 | { |
1428 | if (bfd_elf_discard_info (output_bfd, &link_info)) |
1429 | gldelf_x86_64_obsd_layout_sections_again (); |
1430 | |
1431 | finish_default (); |
1432 | } |
1433 | |
1434 | static char * |
1435 | gldelf_x86_64_obsd_get_script (int *isfile) |
1436 | { |
1437 | *isfile = 0; |
1438 | |
1439 | if (link_info.relocatable && config.build_constructors) |
1440 | return |
1441 | "/* Script for ld -Ur: link w/out relocation, do create constructors */\n\ |
1442 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
1443 | \"elf64-x86-64\")\n\ |
1444 | OUTPUT_ARCH(i386:x86-64)\n\ |
1445 | ENTRY(_start)\n\ |
1446 | /* For some reason, the Solaris linker makes bad executables\n\ |
1447 | if gld -r is used and the intermediate file has sections starting\n\ |
1448 | at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld\n\ |
1449 | bug. But for now assigning the zero vmas works. */\n\ |
1450 | SECTIONS\n\ |
1451 | {\n\ |
1452 | /* Read-only sections, merged into text segment: */\n\ |
1453 | .init 0 :\n\ |
1454 | {\n\ |
1455 | KEEP (*(.init))\n\ |
1456 | } =0x090909090\n\ |
1457 | .plt 0 : { *(.plt) }\n\ |
1458 | .text 0 :\n\ |
1459 | {\n\ |
1460 | *(.text .stub)\n\ |
1461 | KEEP (*(.text.*personality*))\n\ |
1462 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
1463 | *(.gnu.warning)\n\ |
1464 | } =0xcccccccc\n\ |
1465 | .fini 0 :\n" |
1466 | " {\n\ |
1467 | KEEP (*(.fini))\n\ |
1468 | } =0x090909090\n\ |
1469 | .interp 0 : { *(.interp) }\n\ |
1470 | .hash 0 : { *(.hash) }\n\ |
1471 | .gnu.hash 0 : { *(.gnu.hash) }\n\ |
1472 | .dynsym 0 : { *(.dynsym) }\n\ |
1473 | .dynstr 0 : { *(.dynstr) }\n\ |
1474 | .gnu.version 0 : { *(.gnu.version) }\n\ |
1475 | .gnu.version_d 0: { *(.gnu.version_d) }\n\ |
1476 | .gnu.version_r 0: { *(.gnu.version_r) }\n\ |
1477 | .rel.init 0 : { *(.rel.init) }\n\ |
1478 | .rela.init 0 : { *(.rela.init) }\n\ |
1479 | .rel.text 0 : { *(.rel.text) }\n\ |
1480 | .rela.text 0 : { *(.rela.text) }\n\ |
1481 | .rel.fini 0 : { *(.rel.fini) }\n\ |
1482 | .rela.fini 0 : { *(.rela.fini) }\n\ |
1483 | .rel.rodata 0 : { *(.rel.rodata) }\n\ |
1484 | .rela.rodata 0 : { *(.rela.rodata) }\n\ |
1485 | .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }\n\ |
1486 | .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }\n\ |
1487 | .rel.data 0 : { *(.rel.data) }\n\ |
1488 | .rela.data 0 : { *(.rela.data) }\n\ |
1489 | .rel.tdata 0 : { *(.rel.tdata) }\n\ |
1490 | .rela.tdata 0 : { *(.rela.tdata) }\n" |
1491 | " .rel.tbss 0 : { *(.rel.tbss) }\n\ |
1492 | .rela.tbss 0 : { *(.rela.tbss) }\n\ |
1493 | .rel.ctors 0 : { *(.rel.ctors) }\n\ |
1494 | .rela.ctors 0 : { *(.rela.ctors) }\n\ |
1495 | .rel.dtors 0 : { *(.rel.dtors) }\n\ |
1496 | .rela.dtors 0 : { *(.rela.dtors) }\n\ |
1497 | .rel.got 0 : { *(.rel.got) }\n\ |
1498 | .rela.got 0 : { *(.rela.got) }\n\ |
1499 | .rel.bss 0 : { *(.rel.bss) }\n\ |
1500 | .rela.bss 0 : { *(.rela.bss) }\n\ |
1501 | .rel.ldata 0 : { *(.rel.ldata) }\n\ |
1502 | .rela.ldata 0 : { *(.rela.ldata) }\n\ |
1503 | .rel.lbss 0 : { *(.rel.lbss) }\n\ |
1504 | .rela.lbss 0 : { *(.rela.lbss) }\n\ |
1505 | .rel.lrodata 0 : { *(.rel.lrodata) }\n\ |
1506 | .rela.lrodata 0 : { *(.rela.lrodata) }\n\ |
1507 | .rel.plt 0 : { *(.rel.plt) }\n\ |
1508 | .rela.plt 0 : { *(.rela.plt) }\n\ |
1509 | .rodata 0 : { *(.rodata) }\n\ |
1510 | .rodata1 0 : { *(.rodata1) }\n\ |
1511 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
1512 | .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
1513 | .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1514 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
1515 | the same address within the page on the next page up. */\n" |
1516 | " /* Exception handling */\n\ |
1517 | .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
1518 | .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1519 | /* Thread Local Storage sections */\n\ |
1520 | .tdata 0 : { *(.tdata) }\n\ |
1521 | .tbss 0 : { *(.tbss) }\n\ |
1522 | .preinit_array 0 :\n\ |
1523 | {\n\ |
1524 | KEEP (*(.preinit_array))\n\ |
1525 | }\n\ |
1526 | .init_array 0 :\n\ |
1527 | {\n\ |
1528 | KEEP (*(SORT(.init_array.*)))\n\ |
1529 | KEEP (*(.init_array))\n\ |
1530 | }\n\ |
1531 | .fini_array 0 :\n\ |
1532 | {\n\ |
1533 | KEEP (*(.fini_array))\n\ |
1534 | KEEP (*(SORT(.fini_array.*)))\n\ |
1535 | }\n\ |
1536 | .openbsd.randomdata 0 :\n\ |
1537 | {\n\ |
1538 | *(.openbsd.randomdata)\n\ |
1539 | }\n\ |
1540 | .jcr 0 : { KEEP (*(.jcr)) }\n" |
1541 | " .dynamic 0 : { *(.dynamic) }\n\ |
1542 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
1543 | are relocated here to receive the same mprotect protection as .got */\n\ |
1544 | .got 0 : { *(.got.plt) *(.got) }\n\ |
1545 | .gotpad1 0 : { }\n\ |
1546 | .data 0 :\n\ |
1547 | {\n\ |
1548 | *(.data)\n\ |
1549 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
1550 | SORT(CONSTRUCTORS)\n\ |
1551 | }\n\ |
1552 | .data1 0 : { *(.data1) }\n\ |
1553 | .bss 0 :\n\ |
1554 | {\n\ |
1555 | *(.dynbss)\n\ |
1556 | *(.bss)\n\ |
1557 | *(COMMON)\n\ |
1558 | /* Align here to ensure that the .bss section occupies space up to\n\ |
1559 | _end. Align after .bss to ensure correct alignment even if the\n\ |
1560 | .bss section disappears because there are no input sections.\n\ |
1561 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
1562 | pad the .data section. */\n\ |
1563 | }\n\ |
1564 | .lbss 0 :\n\ |
1565 | {\n\ |
1566 | *(.dynlbss)\n\ |
1567 | *(.lbss)\n\ |
1568 | *(LARGE_COMMON)\n\ |
1569 | }\n\ |
1570 | .lrodata 0 :\n\ |
1571 | {\n\ |
1572 | *(.lrodata)\n\ |
1573 | }\n\ |
1574 | .ldata 0 :\n\ |
1575 | {\n\ |
1576 | *(.ldata)\n\ |
1577 | }\n\ |
1578 | /* Stabs debugging sections. */\n\ |
1579 | .stab 0 : { *(.stab) }\n\ |
1580 | .stabstr 0 : { *(.stabstr) }\n\ |
1581 | .stab.excl 0 : { *(.stab.excl) }\n\ |
1582 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
1583 | .stab.index 0 : { *(.stab.index) }\n\ |
1584 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
1585 | .comment 0 : { *(.comment) }\n\ |
1586 | /* DWARF debug sections.\n\ |
1587 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
1588 | of the section so we begin them at 0. */\n\ |
1589 | /* DWARF 1 */\n\ |
1590 | .debug 0 : { *(.debug) }\n\ |
1591 | .line 0 : { *(.line) }\n\ |
1592 | /* GNU DWARF 1 extensions */\n\ |
1593 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
1594 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
1595 | /* DWARF 1.1 and DWARF 2 */\n\ |
1596 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
1597 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
1598 | /* DWARF 2 */\n\ |
1599 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
1600 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
1601 | .debug_line 0 : { *(.debug_line) }\n\ |
1602 | .debug_frame 0 : { *(.debug_frame) }\n\ |
1603 | .debug_str 0 : { *(.debug_str) }\n\ |
1604 | .debug_loc 0 : { *(.debug_loc) }\n\ |
1605 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
1606 | /* SGI/MIPS DWARF 2 extensions */\n\ |
1607 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
1608 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
1609 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
1610 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
1611 | }\n\n" |
1612 | ; else if (link_info.relocatable) return |
1613 | "/* Script for ld -r: link without relocation */\n\ |
1614 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
1615 | \"elf64-x86-64\")\n\ |
1616 | OUTPUT_ARCH(i386:x86-64)\n\ |
1617 | ENTRY(_start)\n\ |
1618 | /* For some reason, the Solaris linker makes bad executables\n\ |
1619 | if gld -r is used and the intermediate file has sections starting\n\ |
1620 | at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld\n\ |
1621 | bug. But for now assigning the zero vmas works. */\n\ |
1622 | SECTIONS\n\ |
1623 | {\n\ |
1624 | /* Read-only sections, merged into text segment: */\n\ |
1625 | .init 0 :\n\ |
1626 | {\n\ |
1627 | KEEP (*(.init))\n\ |
1628 | } =0x090909090\n\ |
1629 | .plt 0 : { *(.plt) }\n\ |
1630 | .text 0 :\n\ |
1631 | {\n\ |
1632 | *(.text .stub)\n\ |
1633 | KEEP (*(.text.*personality*))\n\ |
1634 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
1635 | *(.gnu.warning)\n\ |
1636 | } =0xcccccccc\n\ |
1637 | .fini 0 :\n" |
1638 | " {\n\ |
1639 | KEEP (*(.fini))\n\ |
1640 | } =0x090909090\n\ |
1641 | .interp 0 : { *(.interp) }\n\ |
1642 | .hash 0 : { *(.hash) }\n\ |
1643 | .gnu.hash 0 : { *(.gnu.hash) }\n\ |
1644 | .dynsym 0 : { *(.dynsym) }\n\ |
1645 | .dynstr 0 : { *(.dynstr) }\n\ |
1646 | .gnu.version 0 : { *(.gnu.version) }\n\ |
1647 | .gnu.version_d 0: { *(.gnu.version_d) }\n\ |
1648 | .gnu.version_r 0: { *(.gnu.version_r) }\n\ |
1649 | .rel.init 0 : { *(.rel.init) }\n\ |
1650 | .rela.init 0 : { *(.rela.init) }\n\ |
1651 | .rel.text 0 : { *(.rel.text) }\n\ |
1652 | .rela.text 0 : { *(.rela.text) }\n\ |
1653 | .rel.fini 0 : { *(.rel.fini) }\n\ |
1654 | .rela.fini 0 : { *(.rela.fini) }\n\ |
1655 | .rel.rodata 0 : { *(.rel.rodata) }\n\ |
1656 | .rela.rodata 0 : { *(.rela.rodata) }\n\ |
1657 | .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }\n\ |
1658 | .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }\n\ |
1659 | .rel.data 0 : { *(.rel.data) }\n\ |
1660 | .rela.data 0 : { *(.rela.data) }\n\ |
1661 | .rel.tdata 0 : { *(.rel.tdata) }\n\ |
1662 | .rela.tdata 0 : { *(.rela.tdata) }\n" |
1663 | " .rel.tbss 0 : { *(.rel.tbss) }\n\ |
1664 | .rela.tbss 0 : { *(.rela.tbss) }\n\ |
1665 | .rel.ctors 0 : { *(.rel.ctors) }\n\ |
1666 | .rela.ctors 0 : { *(.rela.ctors) }\n\ |
1667 | .rel.dtors 0 : { *(.rel.dtors) }\n\ |
1668 | .rela.dtors 0 : { *(.rela.dtors) }\n\ |
1669 | .rel.got 0 : { *(.rel.got) }\n\ |
1670 | .rela.got 0 : { *(.rela.got) }\n\ |
1671 | .rel.bss 0 : { *(.rel.bss) }\n\ |
1672 | .rela.bss 0 : { *(.rela.bss) }\n\ |
1673 | .rel.ldata 0 : { *(.rel.ldata) }\n\ |
1674 | .rela.ldata 0 : { *(.rela.ldata) }\n\ |
1675 | .rel.lbss 0 : { *(.rel.lbss) }\n\ |
1676 | .rela.lbss 0 : { *(.rela.lbss) }\n\ |
1677 | .rel.lrodata 0 : { *(.rel.lrodata) }\n\ |
1678 | .rela.lrodata 0 : { *(.rela.lrodata) }\n\ |
1679 | .rel.plt 0 : { *(.rel.plt) }\n\ |
1680 | .rela.plt 0 : { *(.rela.plt) }\n\ |
1681 | .rodata 0 : { *(.rodata) }\n\ |
1682 | .rodata1 0 : { *(.rodata1) }\n\ |
1683 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
1684 | .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
1685 | .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1686 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
1687 | the same address within the page on the next page up. */\n" |
1688 | " /* Exception handling */\n\ |
1689 | .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
1690 | .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1691 | /* Thread Local Storage sections */\n\ |
1692 | .tdata 0 : { *(.tdata) }\n\ |
1693 | .tbss 0 : { *(.tbss) }\n\ |
1694 | .preinit_array 0 :\n\ |
1695 | {\n\ |
1696 | KEEP (*(.preinit_array))\n\ |
1697 | }\n\ |
1698 | .init_array 0 :\n\ |
1699 | {\n\ |
1700 | KEEP (*(SORT(.init_array.*)))\n\ |
1701 | KEEP (*(.init_array))\n\ |
1702 | }\n\ |
1703 | .fini_array 0 :\n\ |
1704 | {\n\ |
1705 | KEEP (*(.fini_array))\n\ |
1706 | KEEP (*(SORT(.fini_array.*)))\n\ |
1707 | }\n\ |
1708 | .openbsd.randomdata 0 :\n\ |
1709 | {\n\ |
1710 | *(.openbsd.randomdata)\n\ |
1711 | }\n\ |
1712 | .jcr 0 : { KEEP (*(.jcr)) }\n" |
1713 | " .dynamic 0 : { *(.dynamic) }\n\ |
1714 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
1715 | are relocated here to receive the same mprotect protection as .got */\n\ |
1716 | .got 0 : { *(.got.plt) *(.got) }\n\ |
1717 | .gotpad1 0 : { }\n\ |
1718 | .data 0 :\n\ |
1719 | {\n\ |
1720 | *(.data)\n\ |
1721 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
1722 | }\n\ |
1723 | .data1 0 : { *(.data1) }\n\ |
1724 | .bss 0 :\n\ |
1725 | {\n\ |
1726 | *(.dynbss)\n\ |
1727 | *(.bss)\n\ |
1728 | *(COMMON)\n\ |
1729 | /* Align here to ensure that the .bss section occupies space up to\n\ |
1730 | _end. Align after .bss to ensure correct alignment even if the\n\ |
1731 | .bss section disappears because there are no input sections.\n\ |
1732 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
1733 | pad the .data section. */\n\ |
1734 | }\n\ |
1735 | .lbss 0 :\n\ |
1736 | {\n\ |
1737 | *(.dynlbss)\n\ |
1738 | *(.lbss)\n\ |
1739 | *(LARGE_COMMON)\n\ |
1740 | }\n\ |
1741 | .lrodata 0 :\n\ |
1742 | {\n\ |
1743 | *(.lrodata)\n\ |
1744 | }\n\ |
1745 | .ldata 0 :\n\ |
1746 | {\n\ |
1747 | *(.ldata)\n\ |
1748 | }\n\ |
1749 | /* Stabs debugging sections. */\n\ |
1750 | .stab 0 : { *(.stab) }\n\ |
1751 | .stabstr 0 : { *(.stabstr) }\n\ |
1752 | .stab.excl 0 : { *(.stab.excl) }\n\ |
1753 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
1754 | .stab.index 0 : { *(.stab.index) }\n\ |
1755 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
1756 | .comment 0 : { *(.comment) }\n\ |
1757 | /* DWARF debug sections.\n\ |
1758 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
1759 | of the section so we begin them at 0. */\n\ |
1760 | /* DWARF 1 */\n\ |
1761 | .debug 0 : { *(.debug) }\n\ |
1762 | .line 0 : { *(.line) }\n\ |
1763 | /* GNU DWARF 1 extensions */\n\ |
1764 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
1765 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
1766 | /* DWARF 1.1 and DWARF 2 */\n\ |
1767 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
1768 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
1769 | /* DWARF 2 */\n\ |
1770 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
1771 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
1772 | .debug_line 0 : { *(.debug_line) }\n\ |
1773 | .debug_frame 0 : { *(.debug_frame) }\n\ |
1774 | .debug_str 0 : { *(.debug_str) }\n\ |
1775 | .debug_loc 0 : { *(.debug_loc) }\n\ |
1776 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
1777 | /* SGI/MIPS DWARF 2 extensions */\n\ |
1778 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
1779 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
1780 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
1781 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
1782 | }\n\n" |
1783 | ; else if (!config.text_read_only) return |
1784 | "/* Script for -N: mix text and data on same page; don't align data */\n\ |
1785 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
1786 | \"elf64-x86-64\")\n\ |
1787 | OUTPUT_ARCH(i386:x86-64)\n\ |
1788 | ENTRY(_start)\n\ |
1789 | SEARCH_DIR(\"/usr/lib\");\n\ |
1790 | SECTIONS\n\ |
1791 | {\n\ |
1792 | /* Read-only sections, merged into text segment: */\n\ |
1793 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
1794 | .init :\n\ |
1795 | {\n\ |
1796 | KEEP (*(.init))\n\ |
1797 | } =0x090909090\n\ |
1798 | .plt : { *(.plt) }\n\ |
1799 | .text :\n\ |
1800 | {\n\ |
1801 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
1802 | KEEP (*(.text.*personality*))\n\ |
1803 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
1804 | *(.gnu.warning)\n\ |
1805 | } =0xcccccccc\n\ |
1806 | .fini :\n\ |
1807 | {\n\ |
1808 | KEEP (*(.fini))\n" |
1809 | " } =0x090909090\n\ |
1810 | PROVIDE (__etext = .);\n\ |
1811 | PROVIDE (_etext = .);\n\ |
1812 | PROVIDE (etext = .);\n\ |
1813 | .interp : { *(.interp) }\n\ |
1814 | .hash : { *(.hash) }\n\ |
1815 | .gnu.hash : { *(.gnu.hash) }\n\ |
1816 | .dynsym : { *(.dynsym) }\n\ |
1817 | .dynstr : { *(.dynstr) }\n\ |
1818 | .gnu.version : { *(.gnu.version) }\n\ |
1819 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
1820 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
1821 | .rel.init : { *(.rel.init) }\n\ |
1822 | .rela.init : { *(.rela.init) }\n\ |
1823 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
1824 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
1825 | .rel.fini : { *(.rel.fini) }\n\ |
1826 | .rela.fini : { *(.rela.fini) }\n\ |
1827 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
1828 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
1829 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
1830 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
1831 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
1832 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n\ |
1833 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n" |
1834 | " .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
1835 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
1836 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
1837 | .rel.ctors : { *(.rel.ctors) }\n\ |
1838 | .rela.ctors : { *(.rela.ctors) }\n\ |
1839 | .rel.dtors : { *(.rel.dtors) }\n\ |
1840 | .rela.dtors : { *(.rela.dtors) }\n\ |
1841 | .rel.got : { *(.rel.got) }\n\ |
1842 | .rela.got : { *(.rela.got) }\n\ |
1843 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
1844 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
1845 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
1846 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
1847 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
1848 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
1849 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
1850 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
1851 | .rel.plt : { *(.rel.plt) }\n\ |
1852 | .rela.plt : { *(.rela.plt) }\n\ |
1853 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
1854 | .rodata1 : { *(.rodata1) }\n\ |
1855 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
1856 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
1857 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1858 | /* Adjust the address for the data segment. We want to adjust up to\n" |
1859 | " the same address within the page on the next page up. */\n\ |
1860 | . = .;\n\ |
1861 | PROVIDE_HIDDEN(__got_start = .);\n\ |
1862 | /* Exception handling */\n\ |
1863 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
1864 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
1865 | /* Thread Local Storage sections */\n\ |
1866 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
1867 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
1868 | .preinit_array :\n\ |
1869 | {\n\ |
1870 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
1871 | KEEP (*(.preinit_array))\n\ |
1872 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
1873 | }\n\ |
1874 | .init_array :\n\ |
1875 | {\n\ |
1876 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
1877 | KEEP (*(SORT(.init_array.*)))\n\ |
1878 | KEEP (*(.init_array))\n\ |
1879 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
1880 | }\n\ |
1881 | .fini_array :\n\ |
1882 | {\n\ |
1883 | PROVIDE_HIDDEN (__fini_array_start = .);\n" |
1884 | " KEEP (*(.fini_array))\n\ |
1885 | KEEP (*(SORT(.fini_array.*)))\n\ |
1886 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
1887 | }\n\ |
1888 | .openbsd.randomdata :\n\ |
1889 | {\n\ |
1890 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
1891 | }\n\ |
1892 | .ctors :\n\ |
1893 | {\n\ |
1894 | /* gcc uses crtbegin.o to find the start of\n\ |
1895 | the constructors, so we make sure it is\n\ |
1896 | first. Because this is a wildcard, it\n\ |
1897 | doesn't matter if the user does not\n\ |
1898 | actually link against crtbegin.o; the\n\ |
1899 | linker won't look for a file to match a\n\ |
1900 | wildcard. The wildcard also means that it\n\ |
1901 | doesn't matter which directory crtbegin.o\n\ |
1902 | is in. */\n\ |
1903 | KEEP (*crtbegin*.o(.ctors))\n\ |
1904 | /* We don't want to include the .ctor section from\n\ |
1905 | the crtend.o file until after the sorted ctors.\n\ |
1906 | The .ctor section from the crtend file contains the\n\ |
1907 | end of ctors marker and it must be last */\n\ |
1908 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
1909 | KEEP (*(SORT(.ctors.*)))\n\ |
1910 | KEEP (*(.ctors))\n\ |
1911 | }\n\ |
1912 | .dtors :\n\ |
1913 | {\n\ |
1914 | KEEP (*crtbegin*.o(.dtors))\n\ |
1915 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
1916 | KEEP (*(SORT(.dtors.*)))\n\ |
1917 | KEEP (*(.dtors))\n\ |
1918 | }\n\ |
1919 | .jcr : { KEEP (*(.jcr)) }\n\ |
1920 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
1921 | .dynamic : { *(.dynamic) }\n\ |
1922 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
1923 | are relocated here to receive the same mprotect protection as .got */\n\ |
1924 | .got : { *(.got.plt) *(.got) }\n\ |
1925 | .data :\n\ |
1926 | {\n\ |
1927 | __data_start = . ;\n\ |
1928 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
1929 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
1930 | SORT(CONSTRUCTORS)\n\ |
1931 | }\n\ |
1932 | .data1 : { *(.data1) }\n\ |
1933 | _edata = .; PROVIDE (edata = .);\n\ |
1934 | __bss_start = .;\n\ |
1935 | .bss :\n\ |
1936 | {\n\ |
1937 | *(.dynbss)\n\ |
1938 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
1939 | *(COMMON)\n\ |
1940 | /* Align here to ensure that the .bss section occupies space up to\n\ |
1941 | _end. Align after .bss to ensure correct alignment even if the\n\ |
1942 | .bss section disappears because there are no input sections.\n\ |
1943 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
1944 | pad the .data section. */\n\ |
1945 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
1946 | }\n\ |
1947 | . = ALIGN(64 / 8);\n\ |
1948 | .lbss :\n\ |
1949 | {\n\ |
1950 | *(.dynlbss)\n\ |
1951 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
1952 | *(LARGE_COMMON)\n\ |
1953 | }\n\ |
1954 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
1955 | {\n\ |
1956 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
1957 | }\n\ |
1958 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
1959 | {\n\ |
1960 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
1961 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
1962 | }\n\ |
1963 | . = ALIGN(64 / 8);\n\ |
1964 | _end = .; PROVIDE (end = .);\n\ |
1965 | /* Stabs debugging sections. */\n\ |
1966 | .stab 0 : { *(.stab) }\n\ |
1967 | .stabstr 0 : { *(.stabstr) }\n\ |
1968 | .stab.excl 0 : { *(.stab.excl) }\n\ |
1969 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
1970 | .stab.index 0 : { *(.stab.index) }\n\ |
1971 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
1972 | .comment 0 : { *(.comment) }\n\ |
1973 | /* DWARF debug sections.\n\ |
1974 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
1975 | of the section so we begin them at 0. */\n\ |
1976 | /* DWARF 1 */\n\ |
1977 | .debug 0 : { *(.debug) }\n\ |
1978 | .line 0 : { *(.line) }\n\ |
1979 | /* GNU DWARF 1 extensions */\n\ |
1980 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
1981 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
1982 | /* DWARF 1.1 and DWARF 2 */\n\ |
1983 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
1984 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
1985 | /* DWARF 2 */\n\ |
1986 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
1987 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
1988 | .debug_line 0 : { *(.debug_line) }\n\ |
1989 | .debug_frame 0 : { *(.debug_frame) }\n\ |
1990 | .debug_str 0 : { *(.debug_str) }\n\ |
1991 | .debug_loc 0 : { *(.debug_loc) }\n\ |
1992 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
1993 | /* SGI/MIPS DWARF 2 extensions */\n\ |
1994 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
1995 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
1996 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
1997 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
1998 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
1999 | }\n\n" |
2000 | ; else if (!config.magic_demand_paged) return |
2001 | "/* Script for -n: mix text and data on same page */\n\ |
2002 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
2003 | \"elf64-x86-64\")\n\ |
2004 | OUTPUT_ARCH(i386:x86-64)\n\ |
2005 | ENTRY(_start)\n\ |
2006 | SEARCH_DIR(\"/usr/lib\");\n\ |
2007 | SECTIONS\n\ |
2008 | {\n\ |
2009 | /* Read-only sections, merged into text segment: */\n\ |
2010 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
2011 | .init :\n\ |
2012 | {\n\ |
2013 | KEEP (*(.init))\n\ |
2014 | } =0x090909090\n\ |
2015 | .plt : { *(.plt) }\n\ |
2016 | .text :\n\ |
2017 | {\n\ |
2018 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
2019 | KEEP (*(.text.*personality*))\n\ |
2020 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
2021 | *(.gnu.warning)\n\ |
2022 | } =0xcccccccc\n\ |
2023 | .fini :\n\ |
2024 | {\n\ |
2025 | KEEP (*(.fini))\n" |
2026 | " } =0x090909090\n\ |
2027 | PROVIDE (__etext = .);\n\ |
2028 | PROVIDE (_etext = .);\n\ |
2029 | PROVIDE (etext = .);\n\ |
2030 | .interp : { *(.interp) }\n\ |
2031 | .hash : { *(.hash) }\n\ |
2032 | .gnu.hash : { *(.gnu.hash) }\n\ |
2033 | .dynsym : { *(.dynsym) }\n\ |
2034 | .dynstr : { *(.dynstr) }\n\ |
2035 | .gnu.version : { *(.gnu.version) }\n\ |
2036 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
2037 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
2038 | .rel.init : { *(.rel.init) }\n\ |
2039 | .rela.init : { *(.rela.init) }\n\ |
2040 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
2041 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
2042 | .rel.fini : { *(.rel.fini) }\n\ |
2043 | .rela.fini : { *(.rela.fini) }\n\ |
2044 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
2045 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
2046 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
2047 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
2048 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
2049 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n\ |
2050 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n" |
2051 | " .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
2052 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
2053 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
2054 | .rel.ctors : { *(.rel.ctors) }\n\ |
2055 | .rela.ctors : { *(.rela.ctors) }\n\ |
2056 | .rel.dtors : { *(.rel.dtors) }\n\ |
2057 | .rela.dtors : { *(.rela.dtors) }\n\ |
2058 | .rel.got : { *(.rel.got) }\n\ |
2059 | .rela.got : { *(.rela.got) }\n\ |
2060 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
2061 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
2062 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
2063 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
2064 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
2065 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
2066 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
2067 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
2068 | .rel.plt : { *(.rel.plt) }\n\ |
2069 | .rela.plt : { *(.rela.plt) }\n\ |
2070 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
2071 | .rodata1 : { *(.rodata1) }\n\ |
2072 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
2073 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
2074 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2075 | /* Adjust the address for the data segment. We want to adjust up to\n" |
2076 | " the same address within the page on the next page up. */\n\ |
2077 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
2078 | PROVIDE_HIDDEN(__got_start = .);\n\ |
2079 | /* Exception handling */\n\ |
2080 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
2081 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2082 | /* Thread Local Storage sections */\n\ |
2083 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
2084 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
2085 | .preinit_array :\n\ |
2086 | {\n\ |
2087 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
2088 | KEEP (*(.preinit_array))\n\ |
2089 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
2090 | }\n\ |
2091 | .init_array :\n\ |
2092 | {\n\ |
2093 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
2094 | KEEP (*(SORT(.init_array.*)))\n\ |
2095 | KEEP (*(.init_array))\n\ |
2096 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
2097 | }\n\ |
2098 | .fini_array :\n\ |
2099 | {\n\ |
2100 | PROVIDE_HIDDEN (__fini_array_start = .);\n" |
2101 | " KEEP (*(.fini_array))\n\ |
2102 | KEEP (*(SORT(.fini_array.*)))\n\ |
2103 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
2104 | }\n\ |
2105 | .openbsd.randomdata :\n\ |
2106 | {\n\ |
2107 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
2108 | }\n\ |
2109 | .ctors :\n\ |
2110 | {\n\ |
2111 | /* gcc uses crtbegin.o to find the start of\n\ |
2112 | the constructors, so we make sure it is\n\ |
2113 | first. Because this is a wildcard, it\n\ |
2114 | doesn't matter if the user does not\n\ |
2115 | actually link against crtbegin.o; the\n\ |
2116 | linker won't look for a file to match a\n\ |
2117 | wildcard. The wildcard also means that it\n\ |
2118 | doesn't matter which directory crtbegin.o\n\ |
2119 | is in. */\n\ |
2120 | KEEP (*crtbegin*.o(.ctors))\n\ |
2121 | /* We don't want to include the .ctor section from\n\ |
2122 | the crtend.o file until after the sorted ctors.\n\ |
2123 | The .ctor section from the crtend file contains the\n\ |
2124 | end of ctors marker and it must be last */\n\ |
2125 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
2126 | KEEP (*(SORT(.ctors.*)))\n\ |
2127 | KEEP (*(.ctors))\n\ |
2128 | }\n\ |
2129 | .dtors :\n\ |
2130 | {\n\ |
2131 | KEEP (*crtbegin*.o(.dtors))\n\ |
2132 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
2133 | KEEP (*(SORT(.dtors.*)))\n\ |
2134 | KEEP (*(.dtors))\n\ |
2135 | }\n\ |
2136 | .jcr : { KEEP (*(.jcr)) }\n\ |
2137 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
2138 | .dynamic : { *(.dynamic) }\n\ |
2139 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
2140 | are relocated here to receive the same mprotect protection as .got */\n\ |
2141 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
2142 | .got : { *(.got.plt) *(.got) }\n\ |
2143 | .data :\n\ |
2144 | {\n\ |
2145 | __data_start = . ;\n\ |
2146 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
2147 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
2148 | SORT(CONSTRUCTORS)\n\ |
2149 | }\n\ |
2150 | .data1 : { *(.data1) }\n\ |
2151 | _edata = .; PROVIDE (edata = .);\n\ |
2152 | __bss_start = .;\n\ |
2153 | .bss :\n\ |
2154 | {\n\ |
2155 | *(.dynbss)\n\ |
2156 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
2157 | *(COMMON)\n\ |
2158 | /* Align here to ensure that the .bss section occupies space up to\n\ |
2159 | _end. Align after .bss to ensure correct alignment even if the\n\ |
2160 | .bss section disappears because there are no input sections.\n\ |
2161 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
2162 | pad the .data section. */\n\ |
2163 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2164 | }\n\ |
2165 | . = ALIGN(64 / 8);\n\ |
2166 | .lbss :\n\ |
2167 | {\n\ |
2168 | *(.dynlbss)\n\ |
2169 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
2170 | *(LARGE_COMMON)\n\ |
2171 | }\n\ |
2172 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2173 | {\n\ |
2174 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
2175 | }\n\ |
2176 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2177 | {\n\ |
2178 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
2179 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2180 | }\n\ |
2181 | . = ALIGN(64 / 8);\n\ |
2182 | _end = .; PROVIDE (end = .);\n\ |
2183 | . = DATA_SEGMENT_END (.);\n\ |
2184 | /* Stabs debugging sections. */\n\ |
2185 | .stab 0 : { *(.stab) }\n\ |
2186 | .stabstr 0 : { *(.stabstr) }\n\ |
2187 | .stab.excl 0 : { *(.stab.excl) }\n\ |
2188 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
2189 | .stab.index 0 : { *(.stab.index) }\n\ |
2190 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
2191 | .comment 0 : { *(.comment) }\n\ |
2192 | /* DWARF debug sections.\n\ |
2193 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
2194 | of the section so we begin them at 0. */\n\ |
2195 | /* DWARF 1 */\n\ |
2196 | .debug 0 : { *(.debug) }\n\ |
2197 | .line 0 : { *(.line) }\n\ |
2198 | /* GNU DWARF 1 extensions */\n\ |
2199 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
2200 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
2201 | /* DWARF 1.1 and DWARF 2 */\n\ |
2202 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
2203 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
2204 | /* DWARF 2 */\n\ |
2205 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
2206 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
2207 | .debug_line 0 : { *(.debug_line) }\n\ |
2208 | .debug_frame 0 : { *(.debug_frame) }\n\ |
2209 | .debug_str 0 : { *(.debug_str) }\n\ |
2210 | .debug_loc 0 : { *(.debug_loc) }\n\ |
2211 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
2212 | /* SGI/MIPS DWARF 2 extensions */\n\ |
2213 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
2214 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
2215 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
2216 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
2217 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
2218 | }\n\n" |
2219 | ; else if (link_info.pie && link_info.combreloc |
2220 | && link_info.relro) return |
2221 | "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs */\n\ |
2222 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
2223 | \"elf64-x86-64\")\n\ |
2224 | OUTPUT_ARCH(i386:x86-64)\n\ |
2225 | ENTRY(_start)\n\ |
2226 | SEARCH_DIR(\"/usr/lib\");\n\ |
2227 | SECTIONS\n\ |
2228 | {\n\ |
2229 | /* Read-only sections, merged into text segment: */\n\ |
2230 | . = 0 + SIZEOF_HEADERS;\n\ |
2231 | .init :\n\ |
2232 | {\n\ |
2233 | KEEP (*(.init))\n\ |
2234 | } =0x090909090\n\ |
2235 | .plt : { *(.plt) }\n\ |
2236 | .text :\n\ |
2237 | {\n\ |
2238 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
2239 | KEEP (*(.text.*personality*))\n\ |
2240 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
2241 | *(.gnu.warning)\n\ |
2242 | } =0xcccccccc\n\ |
2243 | .fini :\n\ |
2244 | {\n\ |
2245 | KEEP (*(.fini))\n" |
2246 | " } =0x090909090\n\ |
2247 | PROVIDE (__etext = .);\n\ |
2248 | PROVIDE (_etext = .);\n\ |
2249 | PROVIDE (etext = .);\n\ |
2250 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
2251 | .interp : { *(.interp) }\n\ |
2252 | .hash : { *(.hash) }\n\ |
2253 | .gnu.hash : { *(.gnu.hash) }\n\ |
2254 | .dynsym : { *(.dynsym) }\n\ |
2255 | .dynstr : { *(.dynstr) }\n\ |
2256 | .gnu.version : { *(.gnu.version) }\n\ |
2257 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
2258 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
2259 | .rel.dyn :\n\ |
2260 | {\n\ |
2261 | *(.rel.init)\n\ |
2262 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
2263 | *(.rel.fini)\n\ |
2264 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
2265 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
2266 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
2267 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
2268 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
2269 | *(.rel.ctors)\n\ |
2270 | *(.rel.dtors)\n" |
2271 | " *(.rel.got)\n\ |
2272 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
2273 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
2274 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
2275 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
2276 | }\n\ |
2277 | .rela.dyn :\n\ |
2278 | {\n\ |
2279 | *(.rela.init)\n\ |
2280 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
2281 | *(.rela.fini)\n\ |
2282 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
2283 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
2284 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
2285 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
2286 | *(.rela.ctors)\n\ |
2287 | *(.rela.dtors)\n\ |
2288 | *(.rela.got)\n\ |
2289 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
2290 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
2291 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
2292 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
2293 | }\n\ |
2294 | .rel.plt : { *(.rel.plt) }\n\ |
2295 | .rela.plt : { *(.rela.plt) }\n" |
2296 | " .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
2297 | .rodata1 : { *(.rodata1) }\n\ |
2298 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
2299 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
2300 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2301 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
2302 | the same address within the page on the next page up. */\n\ |
2303 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
2304 | PROVIDE_HIDDEN(__got_start = .);\n\ |
2305 | /* Exception handling */\n\ |
2306 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
2307 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2308 | /* Thread Local Storage sections */\n\ |
2309 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
2310 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
2311 | .preinit_array :\n\ |
2312 | {\n\ |
2313 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
2314 | KEEP (*(.preinit_array))\n\ |
2315 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
2316 | }\n\ |
2317 | .init_array :\n\ |
2318 | {\n\ |
2319 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
2320 | KEEP (*(SORT(.init_array.*)))\n" |
2321 | " KEEP (*(.init_array))\n\ |
2322 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
2323 | }\n\ |
2324 | .fini_array :\n\ |
2325 | {\n\ |
2326 | PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
2327 | KEEP (*(.fini_array))\n\ |
2328 | KEEP (*(SORT(.fini_array.*)))\n\ |
2329 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
2330 | }\n\ |
2331 | .openbsd.randomdata :\n\ |
2332 | {\n\ |
2333 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
2334 | }\n\ |
2335 | .jcr : { KEEP (*(.jcr)) }\n\ |
2336 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
2337 | .dynamic : { *(.dynamic) }\n\ |
2338 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
2339 | are relocated here to receive the same mprotect protection as .got */\n\ |
2340 | .ctors :\n\ |
2341 | {\n\ |
2342 | /* gcc uses crtbegin.o to find the start of\n\ |
2343 | the constructors, so we make sure it is\n\ |
2344 | first. Because this is a wildcard, it\n\ |
2345 | doesn't matter if the user does not\n\ |
2346 | actually link against crtbegin.o; the\n\ |
2347 | linker won't look for a file to match a\n\ |
2348 | wildcard. The wildcard also means that it\n\ |
2349 | doesn't matter which directory crtbegin.o\n\ |
2350 | is in. */\n\ |
2351 | KEEP (*crtbegin*.o(.ctors))\n\ |
2352 | /* We don't want to include the .ctor section from\n\ |
2353 | the crtend.o file until after the sorted ctors.\n\ |
2354 | The .ctor section from the crtend file contains the\n\ |
2355 | end of ctors marker and it must be last */\n\ |
2356 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
2357 | KEEP (*(SORT(.ctors.*)))\n\ |
2358 | KEEP (*(.ctors))\n\ |
2359 | }\n\ |
2360 | .dtors :\n\ |
2361 | {\n\ |
2362 | KEEP (*crtbegin*.o(.dtors))\n\ |
2363 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
2364 | KEEP (*(SORT(.dtors.*)))\n\ |
2365 | KEEP (*(.dtors))\n\ |
2366 | }\n\ |
2367 | .got : { *(.got.plt) *(.got) }\n\ |
2368 | PROVIDE_HIDDEN(__got_end = .);\n\ |
2369 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
2370 | .data :\n\ |
2371 | {\n\ |
2372 | __data_start = . ;\n\ |
2373 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
2374 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
2375 | SORT(CONSTRUCTORS)\n\ |
2376 | }\n\ |
2377 | .data1 : { *(.data1) }\n\ |
2378 | _edata = .; PROVIDE (edata = .);\n\ |
2379 | __bss_start = .;\n\ |
2380 | .bss :\n\ |
2381 | {\n\ |
2382 | *(.dynbss)\n\ |
2383 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
2384 | *(COMMON)\n\ |
2385 | /* Align here to ensure that the .bss section occupies space up to\n\ |
2386 | _end. Align after .bss to ensure correct alignment even if the\n\ |
2387 | .bss section disappears because there are no input sections.\n\ |
2388 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
2389 | pad the .data section. */\n\ |
2390 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2391 | }\n\ |
2392 | . = ALIGN(64 / 8);\n\ |
2393 | .lbss :\n\ |
2394 | {\n\ |
2395 | *(.dynlbss)\n\ |
2396 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
2397 | *(LARGE_COMMON)\n\ |
2398 | }\n\ |
2399 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2400 | {\n\ |
2401 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
2402 | }\n\ |
2403 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2404 | {\n\ |
2405 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
2406 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2407 | }\n\ |
2408 | . = ALIGN(64 / 8);\n\ |
2409 | _end = .; PROVIDE (end = .);\n\ |
2410 | . = DATA_SEGMENT_END (.);\n\ |
2411 | /* Stabs debugging sections. */\n\ |
2412 | .stab 0 : { *(.stab) }\n\ |
2413 | .stabstr 0 : { *(.stabstr) }\n\ |
2414 | .stab.excl 0 : { *(.stab.excl) }\n\ |
2415 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
2416 | .stab.index 0 : { *(.stab.index) }\n\ |
2417 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
2418 | .comment 0 : { *(.comment) }\n\ |
2419 | /* DWARF debug sections.\n\ |
2420 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
2421 | of the section so we begin them at 0. */\n\ |
2422 | /* DWARF 1 */\n\ |
2423 | .debug 0 : { *(.debug) }\n\ |
2424 | .line 0 : { *(.line) }\n\ |
2425 | /* GNU DWARF 1 extensions */\n\ |
2426 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
2427 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
2428 | /* DWARF 1.1 and DWARF 2 */\n\ |
2429 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
2430 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
2431 | /* DWARF 2 */\n\ |
2432 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
2433 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
2434 | .debug_line 0 : { *(.debug_line) }\n\ |
2435 | .debug_frame 0 : { *(.debug_frame) }\n\ |
2436 | .debug_str 0 : { *(.debug_str) }\n\ |
2437 | .debug_loc 0 : { *(.debug_loc) }\n\ |
2438 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
2439 | /* SGI/MIPS DWARF 2 extensions */\n\ |
2440 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
2441 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
2442 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
2443 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
2444 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
2445 | }\n\n" |
2446 | ; else if (link_info.pie && link_info.combreloc && config.data_bss_contig == TRUE1) return |
2447 | "/* Script for -pie -z combreloc, -Z: position independent executable, combine & sort relocs, no PLT/GOT padding */\n\ |
2448 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
2449 | \"elf64-x86-64\")\n\ |
2450 | OUTPUT_ARCH(i386:x86-64)\n\ |
2451 | ENTRY(_start)\n\ |
2452 | SEARCH_DIR(\"/usr/lib\");\n\ |
2453 | SECTIONS\n\ |
2454 | {\n\ |
2455 | /* Read-only sections, merged into text segment: */\n\ |
2456 | . = 0 + SIZEOF_HEADERS;\n\ |
2457 | .init :\n\ |
2458 | {\n\ |
2459 | KEEP (*(.init))\n\ |
2460 | } =0x090909090\n\ |
2461 | .plt : { *(.plt) }\n\ |
2462 | .text :\n\ |
2463 | {\n\ |
2464 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
2465 | KEEP (*(.text.*personality*))\n\ |
2466 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
2467 | *(.gnu.warning)\n\ |
2468 | } =0xcccccccc\n\ |
2469 | .fini :\n\ |
2470 | {\n\ |
2471 | KEEP (*(.fini))\n" |
2472 | " } =0x090909090\n\ |
2473 | PROVIDE (__etext = .);\n\ |
2474 | PROVIDE (_etext = .);\n\ |
2475 | PROVIDE (etext = .);\n\ |
2476 | .interp : { *(.interp) }\n\ |
2477 | .hash : { *(.hash) }\n\ |
2478 | .gnu.hash : { *(.gnu.hash) }\n\ |
2479 | .dynsym : { *(.dynsym) }\n\ |
2480 | .dynstr : { *(.dynstr) }\n\ |
2481 | .gnu.version : { *(.gnu.version) }\n\ |
2482 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
2483 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
2484 | .rel.dyn :\n\ |
2485 | {\n\ |
2486 | *(.rel.init)\n\ |
2487 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
2488 | *(.rel.fini)\n\ |
2489 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
2490 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
2491 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
2492 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
2493 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
2494 | *(.rel.ctors)\n\ |
2495 | *(.rel.dtors)\n\ |
2496 | *(.rel.got)\n" |
2497 | " *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
2498 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
2499 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
2500 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
2501 | }\n\ |
2502 | .rela.dyn :\n\ |
2503 | {\n\ |
2504 | *(.rela.init)\n\ |
2505 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
2506 | *(.rela.fini)\n\ |
2507 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
2508 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
2509 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
2510 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
2511 | *(.rela.ctors)\n\ |
2512 | *(.rela.dtors)\n\ |
2513 | *(.rela.got)\n\ |
2514 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
2515 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
2516 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
2517 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
2518 | }\n\ |
2519 | .rel.plt : { *(.rel.plt) }\n\ |
2520 | .rela.plt : { *(.rela.plt) }\n\ |
2521 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n" |
2522 | " .rodata1 : { *(.rodata1) }\n\ |
2523 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
2524 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
2525 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2526 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
2527 | the same address within the page on the next page up. */\n\ |
2528 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
2529 | PROVIDE_HIDDEN(__got_start = .);\n\ |
2530 | /* Exception handling */\n\ |
2531 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
2532 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2533 | /* Thread Local Storage sections */\n\ |
2534 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
2535 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
2536 | .preinit_array :\n\ |
2537 | {\n\ |
2538 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
2539 | KEEP (*(.preinit_array))\n\ |
2540 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
2541 | }\n\ |
2542 | .init_array :\n\ |
2543 | {\n\ |
2544 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
2545 | KEEP (*(SORT(.init_array.*)))\n\ |
2546 | KEEP (*(.init_array))\n" |
2547 | " PROVIDE_HIDDEN (__init_array_end = .);\n\ |
2548 | }\n\ |
2549 | .fini_array :\n\ |
2550 | {\n\ |
2551 | PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
2552 | KEEP (*(.fini_array))\n\ |
2553 | KEEP (*(SORT(.fini_array.*)))\n\ |
2554 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
2555 | }\n\ |
2556 | .openbsd.randomdata :\n\ |
2557 | {\n\ |
2558 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
2559 | }\n\ |
2560 | .ctors :\n\ |
2561 | {\n\ |
2562 | /* gcc uses crtbegin.o to find the start of\n\ |
2563 | the constructors, so we make sure it is\n\ |
2564 | first. Because this is a wildcard, it\n\ |
2565 | doesn't matter if the user does not\n\ |
2566 | actually link against crtbegin.o; the\n\ |
2567 | linker won't look for a file to match a\n\ |
2568 | wildcard. The wildcard also means that it\n\ |
2569 | doesn't matter which directory crtbegin.o\n\ |
2570 | is in. */\n\ |
2571 | KEEP (*crtbegin*.o(.ctors))\n\ |
2572 | /* We don't want to include the .ctor section from\n\ |
2573 | the crtend.o file until after the sorted ctors.\n\ |
2574 | The .ctor section from the crtend file contains the\n\ |
2575 | end of ctors marker and it must be last */\n\ |
2576 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
2577 | KEEP (*(SORT(.ctors.*)))\n\ |
2578 | KEEP (*(.ctors))\n\ |
2579 | }\n\ |
2580 | .dtors :\n\ |
2581 | {\n\ |
2582 | KEEP (*crtbegin*.o(.dtors))\n\ |
2583 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
2584 | KEEP (*(SORT(.dtors.*)))\n\ |
2585 | KEEP (*(.dtors))\n\ |
2586 | }\n\ |
2587 | .jcr : { KEEP (*(.jcr)) }\n\ |
2588 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
2589 | .dynamic : { *(.dynamic) }\n\ |
2590 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
2591 | are relocated here to receive the same mprotect protection as .got */\n\ |
2592 | .got : { *(.got.plt) *(.got) }\n\ |
2593 | PROVIDE_HIDDEN(__got_end = .);\n\ |
2594 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
2595 | .data :\n\ |
2596 | {\n\ |
2597 | __data_start = . ;\n\ |
2598 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
2599 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
2600 | SORT(CONSTRUCTORS)\n\ |
2601 | }\n\ |
2602 | .data1 : { *(.data1) }\n\ |
2603 | _edata = .; PROVIDE (edata = .);\n\ |
2604 | __bss_start = .;\n\ |
2605 | .bss :\n\ |
2606 | {\n\ |
2607 | *(.dynbss)\n\ |
2608 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
2609 | *(COMMON)\n\ |
2610 | /* Align here to ensure that the .bss section occupies space up to\n\ |
2611 | _end. Align after .bss to ensure correct alignment even if the\n\ |
2612 | .bss section disappears because there are no input sections.\n\ |
2613 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
2614 | pad the .data section. */\n\ |
2615 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2616 | }\n\ |
2617 | . = ALIGN(64 / 8);\n\ |
2618 | .lbss :\n\ |
2619 | {\n\ |
2620 | *(.dynlbss)\n\ |
2621 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
2622 | *(LARGE_COMMON)\n\ |
2623 | }\n\ |
2624 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2625 | {\n\ |
2626 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
2627 | }\n\ |
2628 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2629 | {\n\ |
2630 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
2631 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2632 | }\n\ |
2633 | . = ALIGN(64 / 8);\n\ |
2634 | _end = .; PROVIDE (end = .);\n\ |
2635 | . = DATA_SEGMENT_END (.);\n\ |
2636 | /* Stabs debugging sections. */\n\ |
2637 | .stab 0 : { *(.stab) }\n\ |
2638 | .stabstr 0 : { *(.stabstr) }\n\ |
2639 | .stab.excl 0 : { *(.stab.excl) }\n\ |
2640 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
2641 | .stab.index 0 : { *(.stab.index) }\n\ |
2642 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
2643 | .comment 0 : { *(.comment) }\n\ |
2644 | /* DWARF debug sections.\n\ |
2645 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
2646 | of the section so we begin them at 0. */\n\ |
2647 | /* DWARF 1 */\n\ |
2648 | .debug 0 : { *(.debug) }\n\ |
2649 | .line 0 : { *(.line) }\n\ |
2650 | /* GNU DWARF 1 extensions */\n\ |
2651 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
2652 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
2653 | /* DWARF 1.1 and DWARF 2 */\n\ |
2654 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
2655 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
2656 | /* DWARF 2 */\n\ |
2657 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
2658 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
2659 | .debug_line 0 : { *(.debug_line) }\n\ |
2660 | .debug_frame 0 : { *(.debug_frame) }\n\ |
2661 | .debug_str 0 : { *(.debug_str) }\n\ |
2662 | .debug_loc 0 : { *(.debug_loc) }\n\ |
2663 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
2664 | /* SGI/MIPS DWARF 2 extensions */\n\ |
2665 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
2666 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
2667 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
2668 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
2669 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
2670 | }\n\n" |
2671 | ; else if (link_info.pie && link_info.combreloc) return |
2672 | "/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */\n\ |
2673 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
2674 | \"elf64-x86-64\")\n\ |
2675 | OUTPUT_ARCH(i386:x86-64)\n\ |
2676 | ENTRY(_start)\n\ |
2677 | SEARCH_DIR(\"/usr/lib\");\n\ |
2678 | SECTIONS\n\ |
2679 | {\n\ |
2680 | /* Read-only sections, merged into text segment: */\n\ |
2681 | . = 0 + SIZEOF_HEADERS;\n\ |
2682 | .init :\n\ |
2683 | {\n\ |
2684 | KEEP (*(.init))\n\ |
2685 | } =0x090909090\n\ |
2686 | .plt : { *(.plt) }\n\ |
2687 | .text :\n\ |
2688 | {\n\ |
2689 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
2690 | KEEP (*(.text.*personality*))\n\ |
2691 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
2692 | *(.gnu.warning)\n\ |
2693 | } =0xcccccccc\n\ |
2694 | .fini :\n\ |
2695 | {\n\ |
2696 | KEEP (*(.fini))\n" |
2697 | " } =0x090909090\n\ |
2698 | PROVIDE (__etext = .);\n\ |
2699 | PROVIDE (_etext = .);\n\ |
2700 | PROVIDE (etext = .);\n\ |
2701 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
2702 | .interp : { *(.interp) }\n\ |
2703 | .hash : { *(.hash) }\n\ |
2704 | .gnu.hash : { *(.gnu.hash) }\n\ |
2705 | .dynsym : { *(.dynsym) }\n\ |
2706 | .dynstr : { *(.dynstr) }\n\ |
2707 | .gnu.version : { *(.gnu.version) }\n\ |
2708 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
2709 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
2710 | .rel.dyn :\n\ |
2711 | {\n\ |
2712 | *(.rel.init)\n\ |
2713 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
2714 | *(.rel.fini)\n\ |
2715 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
2716 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
2717 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
2718 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
2719 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
2720 | *(.rel.ctors)\n\ |
2721 | *(.rel.dtors)\n" |
2722 | " *(.rel.got)\n\ |
2723 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
2724 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
2725 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
2726 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
2727 | }\n\ |
2728 | .rela.dyn :\n\ |
2729 | {\n\ |
2730 | *(.rela.init)\n\ |
2731 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
2732 | *(.rela.fini)\n\ |
2733 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
2734 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
2735 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
2736 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
2737 | *(.rela.ctors)\n\ |
2738 | *(.rela.dtors)\n\ |
2739 | *(.rela.got)\n\ |
2740 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
2741 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
2742 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
2743 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
2744 | }\n\ |
2745 | .rel.plt : { *(.rel.plt) }\n\ |
2746 | .rela.plt : { *(.rela.plt) }\n" |
2747 | " .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
2748 | .rodata1 : { *(.rodata1) }\n\ |
2749 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
2750 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
2751 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2752 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
2753 | the same address within the page on the next page up. */\n\ |
2754 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
2755 | PROVIDE_HIDDEN(__got_start = .);\n\ |
2756 | /* Exception handling */\n\ |
2757 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
2758 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2759 | /* Thread Local Storage sections */\n\ |
2760 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
2761 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
2762 | .preinit_array :\n\ |
2763 | {\n\ |
2764 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
2765 | KEEP (*(.preinit_array))\n\ |
2766 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
2767 | }\n\ |
2768 | .init_array :\n\ |
2769 | {\n\ |
2770 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
2771 | KEEP (*(SORT(.init_array.*)))\n" |
2772 | " KEEP (*(.init_array))\n\ |
2773 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
2774 | }\n\ |
2775 | .fini_array :\n\ |
2776 | {\n\ |
2777 | PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
2778 | KEEP (*(.fini_array))\n\ |
2779 | KEEP (*(SORT(.fini_array.*)))\n\ |
2780 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
2781 | }\n\ |
2782 | .openbsd.randomdata :\n\ |
2783 | {\n\ |
2784 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
2785 | }\n\ |
2786 | .jcr : { KEEP (*(.jcr)) }\n\ |
2787 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
2788 | .dynamic : { *(.dynamic) }\n\ |
2789 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
2790 | are relocated here to receive the same mprotect protection as .got */\n\ |
2791 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
2792 | .got : { *(.got.plt) *(.got) }\n\ |
2793 | .ctors :\n\ |
2794 | {\n\ |
2795 | /* gcc uses crtbegin.o to find the start of\n\ |
2796 | the constructors, so we make sure it is\n\ |
2797 | first. Because this is a wildcard, it\n\ |
2798 | doesn't matter if the user does not\n\ |
2799 | actually link against crtbegin.o; the\n\ |
2800 | linker won't look for a file to match a\n\ |
2801 | wildcard. The wildcard also means that it\n\ |
2802 | doesn't matter which directory crtbegin.o\n\ |
2803 | is in. */\n\ |
2804 | KEEP (*crtbegin*.o(.ctors))\n\ |
2805 | /* We don't want to include the .ctor section from\n\ |
2806 | the crtend.o file until after the sorted ctors.\n\ |
2807 | The .ctor section from the crtend file contains the\n\ |
2808 | end of ctors marker and it must be last */\n\ |
2809 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
2810 | KEEP (*(SORT(.ctors.*)))\n\ |
2811 | KEEP (*(.ctors))\n\ |
2812 | }\n\ |
2813 | .dtors :\n\ |
2814 | {\n\ |
2815 | KEEP (*crtbegin*.o(.dtors))\n\ |
2816 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
2817 | KEEP (*(SORT(.dtors.*)))\n\ |
2818 | KEEP (*(.dtors))\n\ |
2819 | }\n\ |
2820 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
2821 | .data :\n\ |
2822 | {\n\ |
2823 | __data_start = . ;\n\ |
2824 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
2825 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
2826 | SORT(CONSTRUCTORS)\n\ |
2827 | }\n\ |
2828 | .data1 : { *(.data1) }\n\ |
2829 | _edata = .; PROVIDE (edata = .);\n\ |
2830 | __bss_start = .;\n\ |
2831 | .bss :\n\ |
2832 | {\n\ |
2833 | *(.dynbss)\n\ |
2834 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
2835 | *(COMMON)\n\ |
2836 | /* Align here to ensure that the .bss section occupies space up to\n\ |
2837 | _end. Align after .bss to ensure correct alignment even if the\n\ |
2838 | .bss section disappears because there are no input sections.\n\ |
2839 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
2840 | pad the .data section. */\n\ |
2841 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2842 | }\n\ |
2843 | . = ALIGN(64 / 8);\n\ |
2844 | .lbss :\n\ |
2845 | {\n\ |
2846 | *(.dynlbss)\n\ |
2847 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
2848 | *(LARGE_COMMON)\n\ |
2849 | }\n\ |
2850 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2851 | {\n\ |
2852 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
2853 | }\n\ |
2854 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
2855 | {\n\ |
2856 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
2857 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
2858 | }\n\ |
2859 | . = ALIGN(64 / 8);\n\ |
2860 | _end = .; PROVIDE (end = .);\n\ |
2861 | . = DATA_SEGMENT_END (.);\n\ |
2862 | /* Stabs debugging sections. */\n\ |
2863 | .stab 0 : { *(.stab) }\n\ |
2864 | .stabstr 0 : { *(.stabstr) }\n\ |
2865 | .stab.excl 0 : { *(.stab.excl) }\n\ |
2866 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
2867 | .stab.index 0 : { *(.stab.index) }\n\ |
2868 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
2869 | .comment 0 : { *(.comment) }\n\ |
2870 | /* DWARF debug sections.\n\ |
2871 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
2872 | of the section so we begin them at 0. */\n\ |
2873 | /* DWARF 1 */\n\ |
2874 | .debug 0 : { *(.debug) }\n\ |
2875 | .line 0 : { *(.line) }\n\ |
2876 | /* GNU DWARF 1 extensions */\n\ |
2877 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
2878 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
2879 | /* DWARF 1.1 and DWARF 2 */\n\ |
2880 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
2881 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
2882 | /* DWARF 2 */\n\ |
2883 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
2884 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
2885 | .debug_line 0 : { *(.debug_line) }\n\ |
2886 | .debug_frame 0 : { *(.debug_frame) }\n\ |
2887 | .debug_str 0 : { *(.debug_str) }\n\ |
2888 | .debug_loc 0 : { *(.debug_loc) }\n\ |
2889 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
2890 | /* SGI/MIPS DWARF 2 extensions */\n\ |
2891 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
2892 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
2893 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
2894 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
2895 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
2896 | }\n\n" |
2897 | ; else if (link_info.pie && config.data_bss_contig == TRUE1) return |
2898 | "/* Script for ld -pie -Z: link position independent executable, no PLT/GOT padding */\n\ |
2899 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
2900 | \"elf64-x86-64\")\n\ |
2901 | OUTPUT_ARCH(i386:x86-64)\n\ |
2902 | ENTRY(_start)\n\ |
2903 | SEARCH_DIR(\"/usr/lib\");\n\ |
2904 | SECTIONS\n\ |
2905 | {\n\ |
2906 | /* Read-only sections, merged into text segment: */\n\ |
2907 | . = 0 + SIZEOF_HEADERS;\n\ |
2908 | .init :\n\ |
2909 | {\n\ |
2910 | KEEP (*(.init))\n\ |
2911 | } =0x090909090\n\ |
2912 | .plt : { *(.plt) }\n\ |
2913 | .text :\n\ |
2914 | {\n\ |
2915 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
2916 | KEEP (*(.text.*personality*))\n\ |
2917 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
2918 | *(.gnu.warning)\n\ |
2919 | } =0xcccccccc\n\ |
2920 | .fini :\n\ |
2921 | {\n\ |
2922 | KEEP (*(.fini))\n" |
2923 | " } =0x090909090\n\ |
2924 | PROVIDE (__etext = .);\n\ |
2925 | PROVIDE (_etext = .);\n\ |
2926 | PROVIDE (etext = .);\n\ |
2927 | .interp : { *(.interp) }\n\ |
2928 | .hash : { *(.hash) }\n\ |
2929 | .gnu.hash : { *(.gnu.hash) }\n\ |
2930 | .dynsym : { *(.dynsym) }\n\ |
2931 | .dynstr : { *(.dynstr) }\n\ |
2932 | .gnu.version : { *(.gnu.version) }\n\ |
2933 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
2934 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
2935 | .rel.init : { *(.rel.init) }\n\ |
2936 | .rela.init : { *(.rela.init) }\n\ |
2937 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
2938 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
2939 | .rel.fini : { *(.rel.fini) }\n\ |
2940 | .rela.fini : { *(.rela.fini) }\n\ |
2941 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
2942 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
2943 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
2944 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
2945 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
2946 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n\ |
2947 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n" |
2948 | " .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
2949 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
2950 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
2951 | .rel.ctors : { *(.rel.ctors) }\n\ |
2952 | .rela.ctors : { *(.rela.ctors) }\n\ |
2953 | .rel.dtors : { *(.rel.dtors) }\n\ |
2954 | .rela.dtors : { *(.rela.dtors) }\n\ |
2955 | .rel.got : { *(.rel.got) }\n\ |
2956 | .rela.got : { *(.rela.got) }\n\ |
2957 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
2958 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
2959 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
2960 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
2961 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
2962 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
2963 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
2964 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
2965 | .rel.plt : { *(.rel.plt) }\n\ |
2966 | .rela.plt : { *(.rela.plt) }\n\ |
2967 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
2968 | .rodata1 : { *(.rodata1) }\n\ |
2969 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
2970 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
2971 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2972 | /* Adjust the address for the data segment. We want to adjust up to\n" |
2973 | " the same address within the page on the next page up. */\n\ |
2974 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
2975 | PROVIDE_HIDDEN(__got_start = .);\n\ |
2976 | /* Exception handling */\n\ |
2977 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
2978 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
2979 | /* Thread Local Storage sections */\n\ |
2980 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
2981 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
2982 | .preinit_array :\n\ |
2983 | {\n\ |
2984 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
2985 | KEEP (*(.preinit_array))\n\ |
2986 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
2987 | }\n\ |
2988 | .init_array :\n\ |
2989 | {\n\ |
2990 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
2991 | KEEP (*(SORT(.init_array.*)))\n\ |
2992 | KEEP (*(.init_array))\n\ |
2993 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
2994 | }\n\ |
2995 | .fini_array :\n\ |
2996 | {\n\ |
2997 | PROVIDE_HIDDEN (__fini_array_start = .);\n" |
2998 | " KEEP (*(.fini_array))\n\ |
2999 | KEEP (*(SORT(.fini_array.*)))\n\ |
3000 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
3001 | }\n\ |
3002 | .openbsd.randomdata :\n\ |
3003 | {\n\ |
3004 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
3005 | }\n\ |
3006 | .ctors :\n\ |
3007 | {\n\ |
3008 | /* gcc uses crtbegin.o to find the start of\n\ |
3009 | the constructors, so we make sure it is\n\ |
3010 | first. Because this is a wildcard, it\n\ |
3011 | doesn't matter if the user does not\n\ |
3012 | actually link against crtbegin.o; the\n\ |
3013 | linker won't look for a file to match a\n\ |
3014 | wildcard. The wildcard also means that it\n\ |
3015 | doesn't matter which directory crtbegin.o\n\ |
3016 | is in. */\n\ |
3017 | KEEP (*crtbegin*.o(.ctors))\n\ |
3018 | /* We don't want to include the .ctor section from\n\ |
3019 | the crtend.o file until after the sorted ctors.\n\ |
3020 | The .ctor section from the crtend file contains the\n\ |
3021 | end of ctors marker and it must be last */\n\ |
3022 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
3023 | KEEP (*(SORT(.ctors.*)))\n\ |
3024 | KEEP (*(.ctors))\n\ |
3025 | }\n\ |
3026 | .dtors :\n\ |
3027 | {\n\ |
3028 | KEEP (*crtbegin*.o(.dtors))\n\ |
3029 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
3030 | KEEP (*(SORT(.dtors.*)))\n\ |
3031 | KEEP (*(.dtors))\n\ |
3032 | }\n\ |
3033 | .jcr : { KEEP (*(.jcr)) }\n\ |
3034 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
3035 | .dynamic : { *(.dynamic) }\n\ |
3036 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
3037 | are relocated here to receive the same mprotect protection as .got */\n\ |
3038 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
3039 | .got : { *(.got.plt) *(.got) }\n\ |
3040 | .data :\n\ |
3041 | {\n\ |
3042 | __data_start = . ;\n\ |
3043 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
3044 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
3045 | SORT(CONSTRUCTORS)\n\ |
3046 | }\n\ |
3047 | .data1 : { *(.data1) }\n\ |
3048 | _edata = .; PROVIDE (edata = .);\n\ |
3049 | __bss_start = .;\n\ |
3050 | .bss :\n\ |
3051 | {\n\ |
3052 | *(.dynbss)\n\ |
3053 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
3054 | *(COMMON)\n\ |
3055 | /* Align here to ensure that the .bss section occupies space up to\n\ |
3056 | _end. Align after .bss to ensure correct alignment even if the\n\ |
3057 | .bss section disappears because there are no input sections.\n\ |
3058 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
3059 | pad the .data section. */\n\ |
3060 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3061 | }\n\ |
3062 | . = ALIGN(64 / 8);\n\ |
3063 | .lbss :\n\ |
3064 | {\n\ |
3065 | *(.dynlbss)\n\ |
3066 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
3067 | *(LARGE_COMMON)\n\ |
3068 | }\n\ |
3069 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3070 | {\n\ |
3071 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
3072 | }\n\ |
3073 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3074 | {\n\ |
3075 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
3076 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3077 | }\n\ |
3078 | . = ALIGN(64 / 8);\n\ |
3079 | _end = .; PROVIDE (end = .);\n\ |
3080 | . = DATA_SEGMENT_END (.);\n\ |
3081 | /* Stabs debugging sections. */\n\ |
3082 | .stab 0 : { *(.stab) }\n\ |
3083 | .stabstr 0 : { *(.stabstr) }\n\ |
3084 | .stab.excl 0 : { *(.stab.excl) }\n\ |
3085 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
3086 | .stab.index 0 : { *(.stab.index) }\n\ |
3087 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
3088 | .comment 0 : { *(.comment) }\n\ |
3089 | /* DWARF debug sections.\n\ |
3090 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
3091 | of the section so we begin them at 0. */\n\ |
3092 | /* DWARF 1 */\n\ |
3093 | .debug 0 : { *(.debug) }\n\ |
3094 | .line 0 : { *(.line) }\n\ |
3095 | /* GNU DWARF 1 extensions */\n\ |
3096 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
3097 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
3098 | /* DWARF 1.1 and DWARF 2 */\n\ |
3099 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
3100 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
3101 | /* DWARF 2 */\n\ |
3102 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
3103 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
3104 | .debug_line 0 : { *(.debug_line) }\n\ |
3105 | .debug_frame 0 : { *(.debug_frame) }\n\ |
3106 | .debug_str 0 : { *(.debug_str) }\n\ |
3107 | .debug_loc 0 : { *(.debug_loc) }\n\ |
3108 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
3109 | /* SGI/MIPS DWARF 2 extensions */\n\ |
3110 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
3111 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
3112 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
3113 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
3114 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
3115 | }\n\n" |
3116 | ; else if (link_info.pie) return |
3117 | "/* Script for ld -pie: link position independent executable */\n\ |
3118 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
3119 | \"elf64-x86-64\")\n\ |
3120 | OUTPUT_ARCH(i386:x86-64)\n\ |
3121 | ENTRY(_start)\n\ |
3122 | SEARCH_DIR(\"/usr/lib\");\n\ |
3123 | SECTIONS\n\ |
3124 | {\n\ |
3125 | /* Read-only sections, merged into text segment: */\n\ |
3126 | . = 0 + SIZEOF_HEADERS;\n\ |
3127 | .init :\n\ |
3128 | {\n\ |
3129 | KEEP (*(.init))\n\ |
3130 | } =0x090909090\n\ |
3131 | .plt : { *(.plt) }\n\ |
3132 | .text :\n\ |
3133 | {\n\ |
3134 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
3135 | KEEP (*(.text.*personality*))\n\ |
3136 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
3137 | *(.gnu.warning)\n\ |
3138 | } =0xcccccccc\n\ |
3139 | .fini :\n\ |
3140 | {\n\ |
3141 | KEEP (*(.fini))\n" |
3142 | " } =0x090909090\n\ |
3143 | PROVIDE (__etext = .);\n\ |
3144 | PROVIDE (_etext = .);\n\ |
3145 | PROVIDE (etext = .);\n\ |
3146 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
3147 | .interp : { *(.interp) }\n\ |
3148 | .hash : { *(.hash) }\n\ |
3149 | .gnu.hash : { *(.gnu.hash) }\n\ |
3150 | .dynsym : { *(.dynsym) }\n\ |
3151 | .dynstr : { *(.dynstr) }\n\ |
3152 | .gnu.version : { *(.gnu.version) }\n\ |
3153 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
3154 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
3155 | .rel.init : { *(.rel.init) }\n\ |
3156 | .rela.init : { *(.rela.init) }\n\ |
3157 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
3158 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
3159 | .rel.fini : { *(.rel.fini) }\n\ |
3160 | .rela.fini : { *(.rela.fini) }\n\ |
3161 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
3162 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
3163 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
3164 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
3165 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
3166 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n" |
3167 | " .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n\ |
3168 | .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
3169 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
3170 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
3171 | .rel.ctors : { *(.rel.ctors) }\n\ |
3172 | .rela.ctors : { *(.rela.ctors) }\n\ |
3173 | .rel.dtors : { *(.rel.dtors) }\n\ |
3174 | .rela.dtors : { *(.rela.dtors) }\n\ |
3175 | .rel.got : { *(.rel.got) }\n\ |
3176 | .rela.got : { *(.rela.got) }\n\ |
3177 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
3178 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
3179 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
3180 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
3181 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
3182 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
3183 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
3184 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
3185 | .rel.plt : { *(.rel.plt) }\n\ |
3186 | .rela.plt : { *(.rela.plt) }\n\ |
3187 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
3188 | .rodata1 : { *(.rodata1) }\n\ |
3189 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
3190 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
3191 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n" |
3192 | " /* Adjust the address for the data segment. We want to adjust up to\n\ |
3193 | the same address within the page on the next page up. */\n\ |
3194 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
3195 | PROVIDE_HIDDEN(__got_start = .);\n\ |
3196 | /* Exception handling */\n\ |
3197 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
3198 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3199 | /* Thread Local Storage sections */\n\ |
3200 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
3201 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
3202 | .preinit_array :\n\ |
3203 | {\n\ |
3204 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
3205 | KEEP (*(.preinit_array))\n\ |
3206 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
3207 | }\n\ |
3208 | .init_array :\n\ |
3209 | {\n\ |
3210 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
3211 | KEEP (*(SORT(.init_array.*)))\n\ |
3212 | KEEP (*(.init_array))\n\ |
3213 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
3214 | }\n\ |
3215 | .fini_array :\n\ |
3216 | {\n" |
3217 | " PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
3218 | KEEP (*(.fini_array))\n\ |
3219 | KEEP (*(SORT(.fini_array.*)))\n\ |
3220 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
3221 | }\n\ |
3222 | .openbsd.randomdata :\n\ |
3223 | {\n\ |
3224 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
3225 | }\n\ |
3226 | .jcr : { KEEP (*(.jcr)) }\n\ |
3227 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
3228 | .dynamic : { *(.dynamic) }\n\ |
3229 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
3230 | are relocated here to receive the same mprotect protection as .got */\n\ |
3231 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
3232 | .got : { *(.got.plt) *(.got) }\n\ |
3233 | .ctors :\n\ |
3234 | {\n\ |
3235 | /* gcc uses crtbegin.o to find the start of\n\ |
3236 | the constructors, so we make sure it is\n\ |
3237 | first. Because this is a wildcard, it\n\ |
3238 | doesn't matter if the user does not\n\ |
3239 | actually link against crtbegin.o; the\n\ |
3240 | linker won't look for a file to match a\n\ |
3241 | wildcard. The wildcard also means that it\n\ |
3242 | doesn't matter which directory crtbegin.o\n\ |
3243 | is in. */\n\ |
3244 | KEEP (*crtbegin*.o(.ctors))\n\ |
3245 | /* We don't want to include the .ctor section from\n\ |
3246 | the crtend.o file until after the sorted ctors.\n\ |
3247 | The .ctor section from the crtend file contains the\n\ |
3248 | end of ctors marker and it must be last */\n\ |
3249 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
3250 | KEEP (*(SORT(.ctors.*)))\n\ |
3251 | KEEP (*(.ctors))\n\ |
3252 | }\n\ |
3253 | .dtors :\n\ |
3254 | {\n\ |
3255 | KEEP (*crtbegin*.o(.dtors))\n\ |
3256 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
3257 | KEEP (*(SORT(.dtors.*)))\n\ |
3258 | KEEP (*(.dtors))\n\ |
3259 | }\n\ |
3260 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
3261 | .data :\n\ |
3262 | {\n\ |
3263 | __data_start = . ;\n\ |
3264 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
3265 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
3266 | SORT(CONSTRUCTORS)\n\ |
3267 | }\n\ |
3268 | .data1 : { *(.data1) }\n\ |
3269 | _edata = .; PROVIDE (edata = .);\n\ |
3270 | __bss_start = .;\n\ |
3271 | .bss :\n\ |
3272 | {\n\ |
3273 | *(.dynbss)\n\ |
3274 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
3275 | *(COMMON)\n\ |
3276 | /* Align here to ensure that the .bss section occupies space up to\n\ |
3277 | _end. Align after .bss to ensure correct alignment even if the\n\ |
3278 | .bss section disappears because there are no input sections.\n\ |
3279 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
3280 | pad the .data section. */\n\ |
3281 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3282 | }\n\ |
3283 | . = ALIGN(64 / 8);\n\ |
3284 | .lbss :\n\ |
3285 | {\n\ |
3286 | *(.dynlbss)\n\ |
3287 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
3288 | *(LARGE_COMMON)\n\ |
3289 | }\n\ |
3290 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3291 | {\n\ |
3292 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
3293 | }\n\ |
3294 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3295 | {\n\ |
3296 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
3297 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3298 | }\n\ |
3299 | . = ALIGN(64 / 8);\n\ |
3300 | _end = .; PROVIDE (end = .);\n\ |
3301 | . = DATA_SEGMENT_END (.);\n\ |
3302 | /* Stabs debugging sections. */\n\ |
3303 | .stab 0 : { *(.stab) }\n\ |
3304 | .stabstr 0 : { *(.stabstr) }\n\ |
3305 | .stab.excl 0 : { *(.stab.excl) }\n\ |
3306 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
3307 | .stab.index 0 : { *(.stab.index) }\n\ |
3308 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
3309 | .comment 0 : { *(.comment) }\n\ |
3310 | /* DWARF debug sections.\n\ |
3311 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
3312 | of the section so we begin them at 0. */\n\ |
3313 | /* DWARF 1 */\n\ |
3314 | .debug 0 : { *(.debug) }\n\ |
3315 | .line 0 : { *(.line) }\n\ |
3316 | /* GNU DWARF 1 extensions */\n\ |
3317 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
3318 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
3319 | /* DWARF 1.1 and DWARF 2 */\n\ |
3320 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
3321 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
3322 | /* DWARF 2 */\n\ |
3323 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
3324 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
3325 | .debug_line 0 : { *(.debug_line) }\n\ |
3326 | .debug_frame 0 : { *(.debug_frame) }\n\ |
3327 | .debug_str 0 : { *(.debug_str) }\n\ |
3328 | .debug_loc 0 : { *(.debug_loc) }\n\ |
3329 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
3330 | /* SGI/MIPS DWARF 2 extensions */\n\ |
3331 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
3332 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
3333 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
3334 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
3335 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
3336 | }\n\n" |
3337 | ; else if (link_info.shared && link_info.combreloc |
3338 | && link_info.relro) return |
3339 | "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs */\n\ |
3340 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
3341 | \"elf64-x86-64\")\n\ |
3342 | OUTPUT_ARCH(i386:x86-64)\n\ |
3343 | ENTRY(_start)\n\ |
3344 | SEARCH_DIR(\"/usr/lib\");\n\ |
3345 | SECTIONS\n\ |
3346 | {\n\ |
3347 | /* Read-only sections, merged into text segment: */\n\ |
3348 | . = 0 + SIZEOF_HEADERS;\n\ |
3349 | .init :\n\ |
3350 | {\n\ |
3351 | KEEP (*(.init))\n\ |
3352 | } =0x090909090\n\ |
3353 | .plt : { *(.plt) }\n\ |
3354 | .text :\n\ |
3355 | {\n\ |
3356 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
3357 | KEEP (*(.text.*personality*))\n\ |
3358 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
3359 | *(.gnu.warning)\n\ |
3360 | } =0xcccccccc\n\ |
3361 | .fini :\n\ |
3362 | {\n\ |
3363 | KEEP (*(.fini))\n" |
3364 | " } =0x090909090\n\ |
3365 | PROVIDE (__etext = .);\n\ |
3366 | PROVIDE (_etext = .);\n\ |
3367 | PROVIDE (etext = .);\n\ |
3368 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0;\n\ |
3369 | .hash : { *(.hash) }\n\ |
3370 | .gnu.hash : { *(.gnu.hash) }\n\ |
3371 | .dynsym : { *(.dynsym) }\n\ |
3372 | .dynstr : { *(.dynstr) }\n\ |
3373 | .gnu.version : { *(.gnu.version) }\n\ |
3374 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
3375 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
3376 | .rel.dyn :\n\ |
3377 | {\n\ |
3378 | *(.rel.init)\n\ |
3379 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
3380 | *(.rel.fini)\n\ |
3381 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
3382 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
3383 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
3384 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
3385 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
3386 | *(.rel.ctors)\n\ |
3387 | *(.rel.dtors)\n\ |
3388 | *(.rel.got)\n" |
3389 | " *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
3390 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
3391 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
3392 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
3393 | }\n\ |
3394 | .rela.dyn :\n\ |
3395 | {\n\ |
3396 | *(.rela.init)\n\ |
3397 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
3398 | *(.rela.fini)\n\ |
3399 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
3400 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
3401 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
3402 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
3403 | *(.rela.ctors)\n\ |
3404 | *(.rela.dtors)\n\ |
3405 | *(.rela.got)\n\ |
3406 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
3407 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
3408 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
3409 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
3410 | }\n\ |
3411 | .rel.plt : { *(.rel.plt) }\n\ |
3412 | .rela.plt : { *(.rela.plt) }\n\ |
3413 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n" |
3414 | " .rodata1 : { *(.rodata1) }\n\ |
3415 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
3416 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
3417 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3418 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
3419 | the same address within the page on the next page up. */\n\ |
3420 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
3421 | PROVIDE_HIDDEN(__got_start = .);\n\ |
3422 | /* Exception handling */\n\ |
3423 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
3424 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3425 | /* Thread Local Storage sections */\n\ |
3426 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
3427 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
3428 | .preinit_array :\n\ |
3429 | {\n\ |
3430 | KEEP (*(.preinit_array))\n\ |
3431 | }\n\ |
3432 | .init_array :\n\ |
3433 | {\n\ |
3434 | KEEP (*(SORT(.init_array.*)))\n\ |
3435 | KEEP (*(.init_array))\n\ |
3436 | }\n\ |
3437 | .fini_array :\n\ |
3438 | {\n" |
3439 | " KEEP (*(.fini_array))\n\ |
3440 | KEEP (*(SORT(.fini_array.*)))\n\ |
3441 | }\n\ |
3442 | .openbsd.randomdata :\n\ |
3443 | {\n\ |
3444 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
3445 | }\n\ |
3446 | .jcr : { KEEP (*(.jcr)) }\n\ |
3447 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
3448 | .dynamic : { *(.dynamic) }\n\ |
3449 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
3450 | are relocated here to receive the same mprotect protection as .got */\n\ |
3451 | .ctors :\n\ |
3452 | {\n\ |
3453 | /* gcc uses crtbegin.o to find the start of\n\ |
3454 | the constructors, so we make sure it is\n\ |
3455 | first. Because this is a wildcard, it\n\ |
3456 | doesn't matter if the user does not\n\ |
3457 | actually link against crtbegin.o; the\n\ |
3458 | linker won't look for a file to match a\n\ |
3459 | wildcard. The wildcard also means that it\n\ |
3460 | doesn't matter which directory crtbegin.o\n\ |
3461 | is in. */\n\ |
3462 | KEEP (*crtbegin*.o(.ctors))\n\ |
3463 | /* We don't want to include the .ctor section from\n\ |
3464 | the crtend.o file until after the sorted ctors.\n\ |
3465 | The .ctor section from the crtend file contains the\n\ |
3466 | end of ctors marker and it must be last */\n\ |
3467 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
3468 | KEEP (*(SORT(.ctors.*)))\n\ |
3469 | KEEP (*(.ctors))\n\ |
3470 | }\n\ |
3471 | .dtors :\n\ |
3472 | {\n\ |
3473 | KEEP (*crtbegin*.o(.dtors))\n\ |
3474 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
3475 | KEEP (*(SORT(.dtors.*)))\n\ |
3476 | KEEP (*(.dtors))\n\ |
3477 | }\n\ |
3478 | .got : { *(.got.plt) *(.got) }\n\ |
3479 | PROVIDE_HIDDEN(__got_end = .);\n\ |
3480 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
3481 | .data :\n\ |
3482 | {\n\ |
3483 | __data_start = . ;\n\ |
3484 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
3485 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
3486 | SORT(CONSTRUCTORS)\n\ |
3487 | }\n\ |
3488 | .data1 : { *(.data1) }\n\ |
3489 | _edata = .; PROVIDE (edata = .);\n\ |
3490 | __bss_start = .;\n\ |
3491 | .bss :\n\ |
3492 | {\n\ |
3493 | *(.dynbss)\n\ |
3494 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
3495 | *(COMMON)\n\ |
3496 | /* Align here to ensure that the .bss section occupies space up to\n\ |
3497 | _end. Align after .bss to ensure correct alignment even if the\n\ |
3498 | .bss section disappears because there are no input sections.\n\ |
3499 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
3500 | pad the .data section. */\n\ |
3501 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3502 | }\n\ |
3503 | . = ALIGN(64 / 8);\n\ |
3504 | .lbss :\n\ |
3505 | {\n\ |
3506 | *(.dynlbss)\n\ |
3507 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
3508 | *(LARGE_COMMON)\n\ |
3509 | }\n\ |
3510 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3511 | {\n\ |
3512 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
3513 | }\n\ |
3514 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3515 | {\n\ |
3516 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
3517 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3518 | }\n\ |
3519 | . = ALIGN(64 / 8);\n\ |
3520 | _end = .; PROVIDE (end = .);\n\ |
3521 | . = DATA_SEGMENT_END (.);\n\ |
3522 | /* Stabs debugging sections. */\n\ |
3523 | .stab 0 : { *(.stab) }\n\ |
3524 | .stabstr 0 : { *(.stabstr) }\n\ |
3525 | .stab.excl 0 : { *(.stab.excl) }\n\ |
3526 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
3527 | .stab.index 0 : { *(.stab.index) }\n\ |
3528 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
3529 | .comment 0 : { *(.comment) }\n\ |
3530 | /* DWARF debug sections.\n\ |
3531 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
3532 | of the section so we begin them at 0. */\n\ |
3533 | /* DWARF 1 */\n\ |
3534 | .debug 0 : { *(.debug) }\n\ |
3535 | .line 0 : { *(.line) }\n\ |
3536 | /* GNU DWARF 1 extensions */\n\ |
3537 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
3538 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
3539 | /* DWARF 1.1 and DWARF 2 */\n\ |
3540 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
3541 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
3542 | /* DWARF 2 */\n\ |
3543 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
3544 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
3545 | .debug_line 0 : { *(.debug_line) }\n\ |
3546 | .debug_frame 0 : { *(.debug_frame) }\n\ |
3547 | .debug_str 0 : { *(.debug_str) }\n\ |
3548 | .debug_loc 0 : { *(.debug_loc) }\n\ |
3549 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
3550 | /* SGI/MIPS DWARF 2 extensions */\n\ |
3551 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
3552 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
3553 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
3554 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
3555 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
3556 | }\n\n" |
3557 | ; else if (link_info.shared && link_info.combreloc) return |
3558 | "/* Script for --shared -z combreloc: shared library, combine & sort relocs */\n\ |
3559 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
3560 | \"elf64-x86-64\")\n\ |
3561 | OUTPUT_ARCH(i386:x86-64)\n\ |
3562 | ENTRY(_start)\n\ |
3563 | SEARCH_DIR(\"/usr/lib\");\n\ |
3564 | SECTIONS\n\ |
3565 | {\n\ |
3566 | /* Read-only sections, merged into text segment: */\n\ |
3567 | . = 0 + SIZEOF_HEADERS;\n\ |
3568 | .init :\n\ |
3569 | {\n\ |
3570 | KEEP (*(.init))\n\ |
3571 | } =0x090909090\n\ |
3572 | .plt : { *(.plt) }\n\ |
3573 | .text :\n\ |
3574 | {\n\ |
3575 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
3576 | KEEP (*(.text.*personality*))\n\ |
3577 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
3578 | *(.gnu.warning)\n\ |
3579 | } =0xcccccccc\n\ |
3580 | .fini :\n\ |
3581 | {\n\ |
3582 | KEEP (*(.fini))\n" |
3583 | " } =0x090909090\n\ |
3584 | PROVIDE (__etext = .);\n\ |
3585 | PROVIDE (_etext = .);\n\ |
3586 | PROVIDE (etext = .);\n\ |
3587 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0;\n\ |
3588 | .hash : { *(.hash) }\n\ |
3589 | .gnu.hash : { *(.gnu.hash) }\n\ |
3590 | .dynsym : { *(.dynsym) }\n\ |
3591 | .dynstr : { *(.dynstr) }\n\ |
3592 | .gnu.version : { *(.gnu.version) }\n\ |
3593 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
3594 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
3595 | .rel.dyn :\n\ |
3596 | {\n\ |
3597 | *(.rel.init)\n\ |
3598 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
3599 | *(.rel.fini)\n\ |
3600 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
3601 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
3602 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
3603 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
3604 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
3605 | *(.rel.ctors)\n\ |
3606 | *(.rel.dtors)\n\ |
3607 | *(.rel.got)\n" |
3608 | " *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
3609 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
3610 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
3611 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
3612 | }\n\ |
3613 | .rela.dyn :\n\ |
3614 | {\n\ |
3615 | *(.rela.init)\n\ |
3616 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
3617 | *(.rela.fini)\n\ |
3618 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
3619 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
3620 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
3621 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
3622 | *(.rela.ctors)\n\ |
3623 | *(.rela.dtors)\n\ |
3624 | *(.rela.got)\n\ |
3625 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
3626 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
3627 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
3628 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
3629 | }\n\ |
3630 | .rel.plt : { *(.rel.plt) }\n\ |
3631 | .rela.plt : { *(.rela.plt) }\n\ |
3632 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n" |
3633 | " .rodata1 : { *(.rodata1) }\n\ |
3634 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
3635 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
3636 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3637 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
3638 | the same address within the page on the next page up. */\n\ |
3639 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
3640 | PROVIDE_HIDDEN(__got_start = .);\n\ |
3641 | /* Exception handling */\n\ |
3642 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
3643 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3644 | /* Thread Local Storage sections */\n\ |
3645 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
3646 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
3647 | .preinit_array :\n\ |
3648 | {\n\ |
3649 | KEEP (*(.preinit_array))\n\ |
3650 | }\n\ |
3651 | .init_array :\n\ |
3652 | {\n\ |
3653 | KEEP (*(SORT(.init_array.*)))\n\ |
3654 | KEEP (*(.init_array))\n\ |
3655 | }\n\ |
3656 | .fini_array :\n\ |
3657 | {\n" |
3658 | " KEEP (*(.fini_array))\n\ |
3659 | KEEP (*(SORT(.fini_array.*)))\n\ |
3660 | }\n\ |
3661 | .openbsd.randomdata :\n\ |
3662 | {\n\ |
3663 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
3664 | }\n\ |
3665 | .jcr : { KEEP (*(.jcr)) }\n\ |
3666 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
3667 | .dynamic : { *(.dynamic) }\n\ |
3668 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
3669 | are relocated here to receive the same mprotect protection as .got */\n\ |
3670 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
3671 | .got : { *(.got.plt) *(.got) }\n\ |
3672 | .ctors :\n\ |
3673 | {\n\ |
3674 | /* gcc uses crtbegin.o to find the start of\n\ |
3675 | the constructors, so we make sure it is\n\ |
3676 | first. Because this is a wildcard, it\n\ |
3677 | doesn't matter if the user does not\n\ |
3678 | actually link against crtbegin.o; the\n\ |
3679 | linker won't look for a file to match a\n\ |
3680 | wildcard. The wildcard also means that it\n\ |
3681 | doesn't matter which directory crtbegin.o\n\ |
3682 | is in. */\n\ |
3683 | KEEP (*crtbegin*.o(.ctors))\n\ |
3684 | /* We don't want to include the .ctor section from\n\ |
3685 | the crtend.o file until after the sorted ctors.\n\ |
3686 | The .ctor section from the crtend file contains the\n\ |
3687 | end of ctors marker and it must be last */\n\ |
3688 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
3689 | KEEP (*(SORT(.ctors.*)))\n\ |
3690 | KEEP (*(.ctors))\n\ |
3691 | }\n\ |
3692 | .dtors :\n\ |
3693 | {\n\ |
3694 | KEEP (*crtbegin*.o(.dtors))\n\ |
3695 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
3696 | KEEP (*(SORT(.dtors.*)))\n\ |
3697 | KEEP (*(.dtors))\n\ |
3698 | }\n\ |
3699 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
3700 | .data :\n\ |
3701 | {\n\ |
3702 | __data_start = . ;\n\ |
3703 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
3704 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
3705 | SORT(CONSTRUCTORS)\n\ |
3706 | }\n\ |
3707 | .data1 : { *(.data1) }\n\ |
3708 | _edata = .; PROVIDE (edata = .);\n\ |
3709 | __bss_start = .;\n\ |
3710 | .bss :\n\ |
3711 | {\n\ |
3712 | *(.dynbss)\n\ |
3713 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
3714 | *(COMMON)\n\ |
3715 | /* Align here to ensure that the .bss section occupies space up to\n\ |
3716 | _end. Align after .bss to ensure correct alignment even if the\n\ |
3717 | .bss section disappears because there are no input sections.\n\ |
3718 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
3719 | pad the .data section. */\n\ |
3720 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3721 | }\n\ |
3722 | . = ALIGN(64 / 8);\n\ |
3723 | .lbss :\n\ |
3724 | {\n\ |
3725 | *(.dynlbss)\n\ |
3726 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
3727 | *(LARGE_COMMON)\n\ |
3728 | }\n\ |
3729 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3730 | {\n\ |
3731 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
3732 | }\n\ |
3733 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3734 | {\n\ |
3735 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
3736 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3737 | }\n\ |
3738 | . = ALIGN(64 / 8);\n\ |
3739 | _end = .; PROVIDE (end = .);\n\ |
3740 | . = DATA_SEGMENT_END (.);\n\ |
3741 | /* Stabs debugging sections. */\n\ |
3742 | .stab 0 : { *(.stab) }\n\ |
3743 | .stabstr 0 : { *(.stabstr) }\n\ |
3744 | .stab.excl 0 : { *(.stab.excl) }\n\ |
3745 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
3746 | .stab.index 0 : { *(.stab.index) }\n\ |
3747 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
3748 | .comment 0 : { *(.comment) }\n\ |
3749 | /* DWARF debug sections.\n\ |
3750 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
3751 | of the section so we begin them at 0. */\n\ |
3752 | /* DWARF 1 */\n\ |
3753 | .debug 0 : { *(.debug) }\n\ |
3754 | .line 0 : { *(.line) }\n\ |
3755 | /* GNU DWARF 1 extensions */\n\ |
3756 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
3757 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
3758 | /* DWARF 1.1 and DWARF 2 */\n\ |
3759 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
3760 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
3761 | /* DWARF 2 */\n\ |
3762 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
3763 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
3764 | .debug_line 0 : { *(.debug_line) }\n\ |
3765 | .debug_frame 0 : { *(.debug_frame) }\n\ |
3766 | .debug_str 0 : { *(.debug_str) }\n\ |
3767 | .debug_loc 0 : { *(.debug_loc) }\n\ |
3768 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
3769 | /* SGI/MIPS DWARF 2 extensions */\n\ |
3770 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
3771 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
3772 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
3773 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
3774 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
3775 | }\n\n" |
3776 | ; else if (link_info.shared) return |
3777 | "/* Script for ld --shared: link shared library */\n\ |
3778 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
3779 | \"elf64-x86-64\")\n\ |
3780 | OUTPUT_ARCH(i386:x86-64)\n\ |
3781 | ENTRY(_start)\n\ |
3782 | SEARCH_DIR(\"/usr/lib\");\n\ |
3783 | SECTIONS\n\ |
3784 | {\n\ |
3785 | /* Read-only sections, merged into text segment: */\n\ |
3786 | . = 0 + SIZEOF_HEADERS;\n\ |
3787 | .init :\n\ |
3788 | {\n\ |
3789 | KEEP (*(.init))\n\ |
3790 | } =0x090909090\n\ |
3791 | .plt : { *(.plt) }\n\ |
3792 | .text :\n\ |
3793 | {\n\ |
3794 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
3795 | KEEP (*(.text.*personality*))\n\ |
3796 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
3797 | *(.gnu.warning)\n\ |
3798 | } =0xcccccccc\n\ |
3799 | .fini :\n\ |
3800 | {\n\ |
3801 | KEEP (*(.fini))\n" |
3802 | " } =0x090909090\n\ |
3803 | PROVIDE (__etext = .);\n\ |
3804 | PROVIDE (_etext = .);\n\ |
3805 | PROVIDE (etext = .);\n\ |
3806 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0;\n\ |
3807 | .hash : { *(.hash) }\n\ |
3808 | .gnu.hash : { *(.gnu.hash) }\n\ |
3809 | .dynsym : { *(.dynsym) }\n\ |
3810 | .dynstr : { *(.dynstr) }\n\ |
3811 | .gnu.version : { *(.gnu.version) }\n\ |
3812 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
3813 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
3814 | .rel.init : { *(.rel.init) }\n\ |
3815 | .rela.init : { *(.rela.init) }\n\ |
3816 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
3817 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
3818 | .rel.fini : { *(.rel.fini) }\n\ |
3819 | .rela.fini : { *(.rela.fini) }\n\ |
3820 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
3821 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
3822 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
3823 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
3824 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
3825 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n\ |
3826 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n" |
3827 | " .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
3828 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
3829 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
3830 | .rel.ctors : { *(.rel.ctors) }\n\ |
3831 | .rela.ctors : { *(.rela.ctors) }\n\ |
3832 | .rel.dtors : { *(.rel.dtors) }\n\ |
3833 | .rela.dtors : { *(.rela.dtors) }\n\ |
3834 | .rel.got : { *(.rel.got) }\n\ |
3835 | .rela.got : { *(.rela.got) }\n\ |
3836 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
3837 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
3838 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
3839 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
3840 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
3841 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
3842 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
3843 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
3844 | .rel.plt : { *(.rel.plt) }\n\ |
3845 | .rela.plt : { *(.rela.plt) }\n\ |
3846 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
3847 | .rodata1 : { *(.rodata1) }\n\ |
3848 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
3849 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
3850 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3851 | /* Adjust the address for the data segment. We want to adjust up to\n" |
3852 | " the same address within the page on the next page up. */\n\ |
3853 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
3854 | PROVIDE_HIDDEN(__got_start = .);\n\ |
3855 | /* Exception handling */\n\ |
3856 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
3857 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
3858 | /* Thread Local Storage sections */\n\ |
3859 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
3860 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
3861 | .preinit_array :\n\ |
3862 | {\n\ |
3863 | KEEP (*(.preinit_array))\n\ |
3864 | }\n\ |
3865 | .init_array :\n\ |
3866 | {\n\ |
3867 | KEEP (*(SORT(.init_array.*)))\n\ |
3868 | KEEP (*(.init_array))\n\ |
3869 | }\n\ |
3870 | .fini_array :\n\ |
3871 | {\n\ |
3872 | KEEP (*(.fini_array))\n\ |
3873 | KEEP (*(SORT(.fini_array.*)))\n\ |
3874 | }\n\ |
3875 | .openbsd.randomdata :\n\ |
3876 | {\n" |
3877 | " *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
3878 | }\n\ |
3879 | .jcr : { KEEP (*(.jcr)) }\n\ |
3880 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
3881 | .dynamic : { *(.dynamic) }\n\ |
3882 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
3883 | are relocated here to receive the same mprotect protection as .got */\n\ |
3884 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
3885 | .got : { *(.got.plt) *(.got) }\n\ |
3886 | .ctors :\n\ |
3887 | {\n\ |
3888 | /* gcc uses crtbegin.o to find the start of\n\ |
3889 | the constructors, so we make sure it is\n\ |
3890 | first. Because this is a wildcard, it\n\ |
3891 | doesn't matter if the user does not\n\ |
3892 | actually link against crtbegin.o; the\n\ |
3893 | linker won't look for a file to match a\n\ |
3894 | wildcard. The wildcard also means that it\n\ |
3895 | doesn't matter which directory crtbegin.o\n\ |
3896 | is in. */\n\ |
3897 | KEEP (*crtbegin*.o(.ctors))\n\ |
3898 | /* We don't want to include the .ctor section from\n\ |
3899 | the crtend.o file until after the sorted ctors.\n\ |
3900 | The .ctor section from the crtend file contains the\n\ |
3901 | end of ctors marker and it must be last */\n\ |
3902 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
3903 | KEEP (*(SORT(.ctors.*)))\n\ |
3904 | KEEP (*(.ctors))\n\ |
3905 | }\n\ |
3906 | .dtors :\n\ |
3907 | {\n\ |
3908 | KEEP (*crtbegin*.o(.dtors))\n\ |
3909 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
3910 | KEEP (*(SORT(.dtors.*)))\n\ |
3911 | KEEP (*(.dtors))\n\ |
3912 | }\n\ |
3913 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
3914 | .data :\n\ |
3915 | {\n\ |
3916 | __data_start = . ;\n\ |
3917 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
3918 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
3919 | SORT(CONSTRUCTORS)\n\ |
3920 | }\n\ |
3921 | .data1 : { *(.data1) }\n\ |
3922 | _edata = .; PROVIDE (edata = .);\n\ |
3923 | __bss_start = .;\n\ |
3924 | .bss :\n\ |
3925 | {\n\ |
3926 | *(.dynbss)\n\ |
3927 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
3928 | *(COMMON)\n\ |
3929 | /* Align here to ensure that the .bss section occupies space up to\n\ |
3930 | _end. Align after .bss to ensure correct alignment even if the\n\ |
3931 | .bss section disappears because there are no input sections.\n\ |
3932 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
3933 | pad the .data section. */\n\ |
3934 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3935 | }\n\ |
3936 | . = ALIGN(64 / 8);\n\ |
3937 | .lbss :\n\ |
3938 | {\n\ |
3939 | *(.dynlbss)\n\ |
3940 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
3941 | *(LARGE_COMMON)\n\ |
3942 | }\n\ |
3943 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3944 | {\n\ |
3945 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
3946 | }\n\ |
3947 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
3948 | {\n\ |
3949 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
3950 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
3951 | }\n\ |
3952 | . = ALIGN(64 / 8);\n\ |
3953 | _end = .; PROVIDE (end = .);\n\ |
3954 | . = DATA_SEGMENT_END (.);\n\ |
3955 | /* Stabs debugging sections. */\n\ |
3956 | .stab 0 : { *(.stab) }\n\ |
3957 | .stabstr 0 : { *(.stabstr) }\n\ |
3958 | .stab.excl 0 : { *(.stab.excl) }\n\ |
3959 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
3960 | .stab.index 0 : { *(.stab.index) }\n\ |
3961 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
3962 | .comment 0 : { *(.comment) }\n\ |
3963 | /* DWARF debug sections.\n\ |
3964 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
3965 | of the section so we begin them at 0. */\n\ |
3966 | /* DWARF 1 */\n\ |
3967 | .debug 0 : { *(.debug) }\n\ |
3968 | .line 0 : { *(.line) }\n\ |
3969 | /* GNU DWARF 1 extensions */\n\ |
3970 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
3971 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
3972 | /* DWARF 1.1 and DWARF 2 */\n\ |
3973 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
3974 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
3975 | /* DWARF 2 */\n\ |
3976 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
3977 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
3978 | .debug_line 0 : { *(.debug_line) }\n\ |
3979 | .debug_frame 0 : { *(.debug_frame) }\n\ |
3980 | .debug_str 0 : { *(.debug_str) }\n\ |
3981 | .debug_loc 0 : { *(.debug_loc) }\n\ |
3982 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
3983 | /* SGI/MIPS DWARF 2 extensions */\n\ |
3984 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
3985 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
3986 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
3987 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
3988 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
3989 | }\n\n" |
3990 | ; else if (config.data_bss_contig == TRUE1) return |
3991 | "/* Script for -Z: traditional binaries with no PLT/GOT padding */\n\ |
3992 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
3993 | \"elf64-x86-64\")\n\ |
3994 | OUTPUT_ARCH(i386:x86-64)\n\ |
3995 | ENTRY(_start)\n\ |
3996 | SEARCH_DIR(\"/usr/lib\");\n\ |
3997 | SECTIONS\n\ |
3998 | {\n\ |
3999 | /* Read-only sections, merged into text segment: */\n\ |
4000 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
4001 | .init :\n\ |
4002 | {\n\ |
4003 | KEEP (*(.init))\n\ |
4004 | } =0x090909090\n\ |
4005 | .plt : { *(.plt) }\n\ |
4006 | .text :\n\ |
4007 | {\n\ |
4008 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
4009 | KEEP (*(.text.*personality*))\n\ |
4010 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
4011 | *(.gnu.warning)\n\ |
4012 | } =0xcccccccc\n\ |
4013 | .fini :\n\ |
4014 | {\n\ |
4015 | KEEP (*(.fini))\n" |
4016 | " } =0x090909090\n\ |
4017 | PROVIDE (__etext = .);\n\ |
4018 | PROVIDE (_etext = .);\n\ |
4019 | PROVIDE (etext = .);\n\ |
4020 | .interp : { *(.interp) }\n\ |
4021 | .hash : { *(.hash) }\n\ |
4022 | .gnu.hash : { *(.gnu.hash) }\n\ |
4023 | .dynsym : { *(.dynsym) }\n\ |
4024 | .dynstr : { *(.dynstr) }\n\ |
4025 | .gnu.version : { *(.gnu.version) }\n\ |
4026 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
4027 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
4028 | .rel.init : { *(.rel.init) }\n\ |
4029 | .rela.init : { *(.rela.init) }\n\ |
4030 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
4031 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
4032 | .rel.fini : { *(.rel.fini) }\n\ |
4033 | .rela.fini : { *(.rela.fini) }\n\ |
4034 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
4035 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
4036 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
4037 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
4038 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
4039 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n\ |
4040 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n" |
4041 | " .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
4042 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
4043 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
4044 | .rel.ctors : { *(.rel.ctors) }\n\ |
4045 | .rela.ctors : { *(.rela.ctors) }\n\ |
4046 | .rel.dtors : { *(.rel.dtors) }\n\ |
4047 | .rela.dtors : { *(.rela.dtors) }\n\ |
4048 | .rel.got : { *(.rel.got) }\n\ |
4049 | .rela.got : { *(.rela.got) }\n\ |
4050 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
4051 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
4052 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
4053 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
4054 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
4055 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
4056 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
4057 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
4058 | .rel.plt : { *(.rel.plt) }\n\ |
4059 | .rela.plt : { *(.rela.plt) }\n\ |
4060 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
4061 | .rodata1 : { *(.rodata1) }\n\ |
4062 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
4063 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
4064 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4065 | /* Adjust the address for the data segment. We want to adjust up to\n" |
4066 | " the same address within the page on the next page up. */\n\ |
4067 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
4068 | PROVIDE_HIDDEN(__got_start = .);\n\ |
4069 | /* Exception handling */\n\ |
4070 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
4071 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4072 | /* Thread Local Storage sections */\n\ |
4073 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
4074 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
4075 | .preinit_array :\n\ |
4076 | {\n\ |
4077 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
4078 | KEEP (*(.preinit_array))\n\ |
4079 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
4080 | }\n\ |
4081 | .init_array :\n\ |
4082 | {\n\ |
4083 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
4084 | KEEP (*(SORT(.init_array.*)))\n\ |
4085 | KEEP (*(.init_array))\n\ |
4086 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
4087 | }\n\ |
4088 | .fini_array :\n\ |
4089 | {\n\ |
4090 | PROVIDE_HIDDEN (__fini_array_start = .);\n" |
4091 | " KEEP (*(.fini_array))\n\ |
4092 | KEEP (*(SORT(.fini_array.*)))\n\ |
4093 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
4094 | }\n\ |
4095 | .openbsd.randomdata :\n\ |
4096 | {\n\ |
4097 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
4098 | }\n\ |
4099 | .ctors :\n\ |
4100 | {\n\ |
4101 | /* gcc uses crtbegin.o to find the start of\n\ |
4102 | the constructors, so we make sure it is\n\ |
4103 | first. Because this is a wildcard, it\n\ |
4104 | doesn't matter if the user does not\n\ |
4105 | actually link against crtbegin.o; the\n\ |
4106 | linker won't look for a file to match a\n\ |
4107 | wildcard. The wildcard also means that it\n\ |
4108 | doesn't matter which directory crtbegin.o\n\ |
4109 | is in. */\n\ |
4110 | KEEP (*crtbegin*.o(.ctors))\n\ |
4111 | /* We don't want to include the .ctor section from\n\ |
4112 | the crtend.o file until after the sorted ctors.\n\ |
4113 | The .ctor section from the crtend file contains the\n\ |
4114 | end of ctors marker and it must be last */\n\ |
4115 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
4116 | KEEP (*(SORT(.ctors.*)))\n\ |
4117 | KEEP (*(.ctors))\n\ |
4118 | }\n\ |
4119 | .dtors :\n\ |
4120 | {\n\ |
4121 | KEEP (*crtbegin*.o(.dtors))\n\ |
4122 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
4123 | KEEP (*(SORT(.dtors.*)))\n\ |
4124 | KEEP (*(.dtors))\n\ |
4125 | }\n\ |
4126 | .jcr : { KEEP (*(.jcr)) }\n\ |
4127 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
4128 | .dynamic : { *(.dynamic) }\n\ |
4129 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
4130 | are relocated here to receive the same mprotect protection as .got */\n\ |
4131 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
4132 | .got : { *(.got.plt) *(.got) }\n\ |
4133 | .data :\n\ |
4134 | {\n\ |
4135 | __data_start = . ;\n\ |
4136 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
4137 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
4138 | SORT(CONSTRUCTORS)\n\ |
4139 | }\n\ |
4140 | .data1 : { *(.data1) }\n\ |
4141 | _edata = .; PROVIDE (edata = .);\n\ |
4142 | __bss_start = .;\n\ |
4143 | .bss :\n\ |
4144 | {\n\ |
4145 | *(.dynbss)\n\ |
4146 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
4147 | *(COMMON)\n\ |
4148 | /* Align here to ensure that the .bss section occupies space up to\n\ |
4149 | _end. Align after .bss to ensure correct alignment even if the\n\ |
4150 | .bss section disappears because there are no input sections.\n\ |
4151 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
4152 | pad the .data section. */\n\ |
4153 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4154 | }\n\ |
4155 | . = ALIGN(64 / 8);\n\ |
4156 | .lbss :\n\ |
4157 | {\n\ |
4158 | *(.dynlbss)\n\ |
4159 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
4160 | *(LARGE_COMMON)\n\ |
4161 | }\n\ |
4162 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4163 | {\n\ |
4164 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
4165 | }\n\ |
4166 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4167 | {\n\ |
4168 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
4169 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4170 | }\n\ |
4171 | . = ALIGN(64 / 8);\n\ |
4172 | _end = .; PROVIDE (end = .);\n\ |
4173 | . = DATA_SEGMENT_END (.);\n\ |
4174 | /* Stabs debugging sections. */\n\ |
4175 | .stab 0 : { *(.stab) }\n\ |
4176 | .stabstr 0 : { *(.stabstr) }\n\ |
4177 | .stab.excl 0 : { *(.stab.excl) }\n\ |
4178 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
4179 | .stab.index 0 : { *(.stab.index) }\n\ |
4180 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
4181 | .comment 0 : { *(.comment) }\n\ |
4182 | /* DWARF debug sections.\n\ |
4183 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
4184 | of the section so we begin them at 0. */\n\ |
4185 | /* DWARF 1 */\n\ |
4186 | .debug 0 : { *(.debug) }\n\ |
4187 | .line 0 : { *(.line) }\n\ |
4188 | /* GNU DWARF 1 extensions */\n\ |
4189 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
4190 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
4191 | /* DWARF 1.1 and DWARF 2 */\n\ |
4192 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
4193 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
4194 | /* DWARF 2 */\n\ |
4195 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
4196 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
4197 | .debug_line 0 : { *(.debug_line) }\n\ |
4198 | .debug_frame 0 : { *(.debug_frame) }\n\ |
4199 | .debug_str 0 : { *(.debug_str) }\n\ |
4200 | .debug_loc 0 : { *(.debug_loc) }\n\ |
4201 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
4202 | /* SGI/MIPS DWARF 2 extensions */\n\ |
4203 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
4204 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
4205 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
4206 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
4207 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
4208 | }\n\n" |
4209 | ; else if (link_info.combreloc && link_info.relro) return |
4210 | "/* Script for -z combreloc -z relro: combine and sort reloc sections */\n\ |
4211 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
4212 | \"elf64-x86-64\")\n\ |
4213 | OUTPUT_ARCH(i386:x86-64)\n\ |
4214 | ENTRY(_start)\n\ |
4215 | SEARCH_DIR(\"/usr/lib\");\n\ |
4216 | SECTIONS\n\ |
4217 | {\n\ |
4218 | /* Read-only sections, merged into text segment: */\n\ |
4219 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
4220 | .init :\n\ |
4221 | {\n\ |
4222 | KEEP (*(.init))\n\ |
4223 | } =0x090909090\n\ |
4224 | .plt : { *(.plt) }\n\ |
4225 | .text :\n\ |
4226 | {\n\ |
4227 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
4228 | KEEP (*(.text.*personality*))\n\ |
4229 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
4230 | *(.gnu.warning)\n\ |
4231 | } =0xcccccccc\n\ |
4232 | .fini :\n\ |
4233 | {\n\ |
4234 | KEEP (*(.fini))\n" |
4235 | " } =0x090909090\n\ |
4236 | PROVIDE (__etext = .);\n\ |
4237 | PROVIDE (_etext = .);\n\ |
4238 | PROVIDE (etext = .);\n\ |
4239 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
4240 | .interp : { *(.interp) }\n\ |
4241 | .hash : { *(.hash) }\n\ |
4242 | .gnu.hash : { *(.gnu.hash) }\n\ |
4243 | .dynsym : { *(.dynsym) }\n\ |
4244 | .dynstr : { *(.dynstr) }\n\ |
4245 | .gnu.version : { *(.gnu.version) }\n\ |
4246 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
4247 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
4248 | .rel.dyn :\n\ |
4249 | {\n\ |
4250 | *(.rel.init)\n\ |
4251 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
4252 | *(.rel.fini)\n\ |
4253 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
4254 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
4255 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
4256 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
4257 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
4258 | *(.rel.ctors)\n\ |
4259 | *(.rel.dtors)\n" |
4260 | " *(.rel.got)\n\ |
4261 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
4262 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
4263 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
4264 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
4265 | }\n\ |
4266 | .rela.dyn :\n\ |
4267 | {\n\ |
4268 | *(.rela.init)\n\ |
4269 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
4270 | *(.rela.fini)\n\ |
4271 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
4272 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
4273 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
4274 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
4275 | *(.rela.ctors)\n\ |
4276 | *(.rela.dtors)\n\ |
4277 | *(.rela.got)\n\ |
4278 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
4279 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
4280 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
4281 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
4282 | }\n\ |
4283 | .rel.plt : { *(.rel.plt) }\n\ |
4284 | .rela.plt : { *(.rela.plt) }\n" |
4285 | " .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
4286 | .rodata1 : { *(.rodata1) }\n\ |
4287 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
4288 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
4289 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4290 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
4291 | the same address within the page on the next page up. */\n\ |
4292 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
4293 | PROVIDE_HIDDEN(__got_start = .);\n\ |
4294 | /* Exception handling */\n\ |
4295 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
4296 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4297 | /* Thread Local Storage sections */\n\ |
4298 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
4299 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
4300 | .preinit_array :\n\ |
4301 | {\n\ |
4302 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
4303 | KEEP (*(.preinit_array))\n\ |
4304 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
4305 | }\n\ |
4306 | .init_array :\n\ |
4307 | {\n\ |
4308 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
4309 | KEEP (*(SORT(.init_array.*)))\n" |
4310 | " KEEP (*(.init_array))\n\ |
4311 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
4312 | }\n\ |
4313 | .fini_array :\n\ |
4314 | {\n\ |
4315 | PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
4316 | KEEP (*(.fini_array))\n\ |
4317 | KEEP (*(SORT(.fini_array.*)))\n\ |
4318 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
4319 | }\n\ |
4320 | .openbsd.randomdata :\n\ |
4321 | {\n\ |
4322 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
4323 | }\n\ |
4324 | .jcr : { KEEP (*(.jcr)) }\n\ |
4325 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
4326 | .dynamic : { *(.dynamic) }\n\ |
4327 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
4328 | are relocated here to receive the same mprotect protection as .got */\n\ |
4329 | .ctors :\n\ |
4330 | {\n\ |
4331 | /* gcc uses crtbegin.o to find the start of\n\ |
4332 | the constructors, so we make sure it is\n\ |
4333 | first. Because this is a wildcard, it\n\ |
4334 | doesn't matter if the user does not\n\ |
4335 | actually link against crtbegin.o; the\n\ |
4336 | linker won't look for a file to match a\n\ |
4337 | wildcard. The wildcard also means that it\n\ |
4338 | doesn't matter which directory crtbegin.o\n\ |
4339 | is in. */\n\ |
4340 | KEEP (*crtbegin*.o(.ctors))\n\ |
4341 | /* We don't want to include the .ctor section from\n\ |
4342 | the crtend.o file until after the sorted ctors.\n\ |
4343 | The .ctor section from the crtend file contains the\n\ |
4344 | end of ctors marker and it must be last */\n\ |
4345 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
4346 | KEEP (*(SORT(.ctors.*)))\n\ |
4347 | KEEP (*(.ctors))\n\ |
4348 | }\n\ |
4349 | .dtors :\n\ |
4350 | {\n\ |
4351 | KEEP (*crtbegin*.o(.dtors))\n\ |
4352 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
4353 | KEEP (*(SORT(.dtors.*)))\n\ |
4354 | KEEP (*(.dtors))\n\ |
4355 | }\n\ |
4356 | .got : { *(.got.plt) *(.got) }\n\ |
4357 | PROVIDE_HIDDEN(__got_end = .);\n\ |
4358 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
4359 | .data :\n\ |
4360 | {\n\ |
4361 | __data_start = . ;\n\ |
4362 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
4363 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
4364 | SORT(CONSTRUCTORS)\n\ |
4365 | }\n\ |
4366 | .data1 : { *(.data1) }\n\ |
4367 | _edata = .; PROVIDE (edata = .);\n\ |
4368 | __bss_start = .;\n\ |
4369 | .bss :\n\ |
4370 | {\n\ |
4371 | *(.dynbss)\n\ |
4372 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
4373 | *(COMMON)\n\ |
4374 | /* Align here to ensure that the .bss section occupies space up to\n\ |
4375 | _end. Align after .bss to ensure correct alignment even if the\n\ |
4376 | .bss section disappears because there are no input sections.\n\ |
4377 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
4378 | pad the .data section. */\n\ |
4379 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4380 | }\n\ |
4381 | . = ALIGN(64 / 8);\n\ |
4382 | .lbss :\n\ |
4383 | {\n\ |
4384 | *(.dynlbss)\n\ |
4385 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
4386 | *(LARGE_COMMON)\n\ |
4387 | }\n\ |
4388 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4389 | {\n\ |
4390 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
4391 | }\n\ |
4392 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4393 | {\n\ |
4394 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
4395 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4396 | }\n\ |
4397 | . = ALIGN(64 / 8);\n\ |
4398 | _end = .; PROVIDE (end = .);\n\ |
4399 | . = DATA_SEGMENT_END (.);\n\ |
4400 | /* Stabs debugging sections. */\n\ |
4401 | .stab 0 : { *(.stab) }\n\ |
4402 | .stabstr 0 : { *(.stabstr) }\n\ |
4403 | .stab.excl 0 : { *(.stab.excl) }\n\ |
4404 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
4405 | .stab.index 0 : { *(.stab.index) }\n\ |
4406 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
4407 | .comment 0 : { *(.comment) }\n\ |
4408 | /* DWARF debug sections.\n\ |
4409 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
4410 | of the section so we begin them at 0. */\n\ |
4411 | /* DWARF 1 */\n\ |
4412 | .debug 0 : { *(.debug) }\n\ |
4413 | .line 0 : { *(.line) }\n\ |
4414 | /* GNU DWARF 1 extensions */\n\ |
4415 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
4416 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
4417 | /* DWARF 1.1 and DWARF 2 */\n\ |
4418 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
4419 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
4420 | /* DWARF 2 */\n\ |
4421 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
4422 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
4423 | .debug_line 0 : { *(.debug_line) }\n\ |
4424 | .debug_frame 0 : { *(.debug_frame) }\n\ |
4425 | .debug_str 0 : { *(.debug_str) }\n\ |
4426 | .debug_loc 0 : { *(.debug_loc) }\n\ |
4427 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
4428 | /* SGI/MIPS DWARF 2 extensions */\n\ |
4429 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
4430 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
4431 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
4432 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
4433 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
4434 | }\n\n" |
4435 | ; else if (link_info.combreloc) return |
4436 | "/* Script for -z combreloc: combine and sort reloc sections */\n\ |
4437 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
4438 | \"elf64-x86-64\")\n\ |
4439 | OUTPUT_ARCH(i386:x86-64)\n\ |
4440 | ENTRY(_start)\n\ |
4441 | SEARCH_DIR(\"/usr/lib\");\n\ |
4442 | SECTIONS\n\ |
4443 | {\n\ |
4444 | /* Read-only sections, merged into text segment: */\n\ |
4445 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
4446 | .init :\n\ |
4447 | {\n\ |
4448 | KEEP (*(.init))\n\ |
4449 | } =0x090909090\n\ |
4450 | .plt : { *(.plt) }\n\ |
4451 | .text :\n\ |
4452 | {\n\ |
4453 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
4454 | KEEP (*(.text.*personality*))\n\ |
4455 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
4456 | *(.gnu.warning)\n\ |
4457 | } =0xcccccccc\n\ |
4458 | .fini :\n\ |
4459 | {\n\ |
4460 | KEEP (*(.fini))\n" |
4461 | " } =0x090909090\n\ |
4462 | PROVIDE (__etext = .);\n\ |
4463 | PROVIDE (_etext = .);\n\ |
4464 | PROVIDE (etext = .);\n\ |
4465 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
4466 | .interp : { *(.interp) }\n\ |
4467 | .hash : { *(.hash) }\n\ |
4468 | .gnu.hash : { *(.gnu.hash) }\n\ |
4469 | .dynsym : { *(.dynsym) }\n\ |
4470 | .dynstr : { *(.dynstr) }\n\ |
4471 | .gnu.version : { *(.gnu.version) }\n\ |
4472 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
4473 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
4474 | .rel.dyn :\n\ |
4475 | {\n\ |
4476 | *(.rel.init)\n\ |
4477 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\n\ |
4478 | *(.rel.fini)\n\ |
4479 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\n\ |
4480 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\n\ |
4481 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\n\ |
4482 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\n\ |
4483 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\n\ |
4484 | *(.rel.ctors)\n\ |
4485 | *(.rel.dtors)\n" |
4486 | " *(.rel.got)\n\ |
4487 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\n\ |
4488 | *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)\n\ |
4489 | *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)\n\ |
4490 | *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)\n\ |
4491 | }\n\ |
4492 | .rela.dyn :\n\ |
4493 | {\n\ |
4494 | *(.rela.init)\n\ |
4495 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\n\ |
4496 | *(.rela.fini)\n\ |
4497 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\n\ |
4498 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\n\ |
4499 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\n\ |
4500 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\n\ |
4501 | *(.rela.ctors)\n\ |
4502 | *(.rela.dtors)\n\ |
4503 | *(.rela.got)\n\ |
4504 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\n\ |
4505 | *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)\n\ |
4506 | *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)\n\ |
4507 | *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)\n\ |
4508 | }\n\ |
4509 | .rel.plt : { *(.rel.plt) }\n\ |
4510 | .rela.plt : { *(.rela.plt) }\n" |
4511 | " .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
4512 | .rodata1 : { *(.rodata1) }\n\ |
4513 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
4514 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
4515 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4516 | /* Adjust the address for the data segment. We want to adjust up to\n\ |
4517 | the same address within the page on the next page up. */\n\ |
4518 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
4519 | PROVIDE_HIDDEN(__got_start = .);\n\ |
4520 | /* Exception handling */\n\ |
4521 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
4522 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4523 | /* Thread Local Storage sections */\n\ |
4524 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
4525 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
4526 | .preinit_array :\n\ |
4527 | {\n\ |
4528 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
4529 | KEEP (*(.preinit_array))\n\ |
4530 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
4531 | }\n\ |
4532 | .init_array :\n\ |
4533 | {\n\ |
4534 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
4535 | KEEP (*(SORT(.init_array.*)))\n" |
4536 | " KEEP (*(.init_array))\n\ |
4537 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
4538 | }\n\ |
4539 | .fini_array :\n\ |
4540 | {\n\ |
4541 | PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
4542 | KEEP (*(.fini_array))\n\ |
4543 | KEEP (*(SORT(.fini_array.*)))\n\ |
4544 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
4545 | }\n\ |
4546 | .openbsd.randomdata :\n\ |
4547 | {\n\ |
4548 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
4549 | }\n\ |
4550 | .jcr : { KEEP (*(.jcr)) }\n\ |
4551 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
4552 | .dynamic : { *(.dynamic) }\n\ |
4553 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
4554 | are relocated here to receive the same mprotect protection as .got */\n\ |
4555 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
4556 | .got : { *(.got.plt) *(.got) }\n\ |
4557 | .ctors :\n\ |
4558 | {\n\ |
4559 | /* gcc uses crtbegin.o to find the start of\n\ |
4560 | the constructors, so we make sure it is\n\ |
4561 | first. Because this is a wildcard, it\n\ |
4562 | doesn't matter if the user does not\n\ |
4563 | actually link against crtbegin.o; the\n\ |
4564 | linker won't look for a file to match a\n\ |
4565 | wildcard. The wildcard also means that it\n\ |
4566 | doesn't matter which directory crtbegin.o\n\ |
4567 | is in. */\n\ |
4568 | KEEP (*crtbegin*.o(.ctors))\n\ |
4569 | /* We don't want to include the .ctor section from\n\ |
4570 | the crtend.o file until after the sorted ctors.\n\ |
4571 | The .ctor section from the crtend file contains the\n\ |
4572 | end of ctors marker and it must be last */\n\ |
4573 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
4574 | KEEP (*(SORT(.ctors.*)))\n\ |
4575 | KEEP (*(.ctors))\n\ |
4576 | }\n\ |
4577 | .dtors :\n\ |
4578 | {\n\ |
4579 | KEEP (*crtbegin*.o(.dtors))\n\ |
4580 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
4581 | KEEP (*(SORT(.dtors.*)))\n\ |
4582 | KEEP (*(.dtors))\n\ |
4583 | }\n\ |
4584 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
4585 | .data :\n\ |
4586 | {\n\ |
4587 | __data_start = . ;\n\ |
4588 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
4589 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
4590 | SORT(CONSTRUCTORS)\n\ |
4591 | }\n\ |
4592 | .data1 : { *(.data1) }\n\ |
4593 | _edata = .; PROVIDE (edata = .);\n\ |
4594 | __bss_start = .;\n\ |
4595 | .bss :\n\ |
4596 | {\n\ |
4597 | *(.dynbss)\n\ |
4598 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
4599 | *(COMMON)\n\ |
4600 | /* Align here to ensure that the .bss section occupies space up to\n\ |
4601 | _end. Align after .bss to ensure correct alignment even if the\n\ |
4602 | .bss section disappears because there are no input sections.\n\ |
4603 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
4604 | pad the .data section. */\n\ |
4605 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4606 | }\n\ |
4607 | . = ALIGN(64 / 8);\n\ |
4608 | .lbss :\n\ |
4609 | {\n\ |
4610 | *(.dynlbss)\n\ |
4611 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
4612 | *(LARGE_COMMON)\n\ |
4613 | }\n\ |
4614 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4615 | {\n\ |
4616 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
4617 | }\n\ |
4618 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4619 | {\n\ |
4620 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
4621 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4622 | }\n\ |
4623 | . = ALIGN(64 / 8);\n\ |
4624 | _end = .; PROVIDE (end = .);\n\ |
4625 | . = DATA_SEGMENT_END (.);\n\ |
4626 | /* Stabs debugging sections. */\n\ |
4627 | .stab 0 : { *(.stab) }\n\ |
4628 | .stabstr 0 : { *(.stabstr) }\n\ |
4629 | .stab.excl 0 : { *(.stab.excl) }\n\ |
4630 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
4631 | .stab.index 0 : { *(.stab.index) }\n\ |
4632 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
4633 | .comment 0 : { *(.comment) }\n\ |
4634 | /* DWARF debug sections.\n\ |
4635 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
4636 | of the section so we begin them at 0. */\n\ |
4637 | /* DWARF 1 */\n\ |
4638 | .debug 0 : { *(.debug) }\n\ |
4639 | .line 0 : { *(.line) }\n\ |
4640 | /* GNU DWARF 1 extensions */\n\ |
4641 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
4642 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
4643 | /* DWARF 1.1 and DWARF 2 */\n\ |
4644 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
4645 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
4646 | /* DWARF 2 */\n\ |
4647 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
4648 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
4649 | .debug_line 0 : { *(.debug_line) }\n\ |
4650 | .debug_frame 0 : { *(.debug_frame) }\n\ |
4651 | .debug_str 0 : { *(.debug_str) }\n\ |
4652 | .debug_loc 0 : { *(.debug_loc) }\n\ |
4653 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
4654 | /* SGI/MIPS DWARF 2 extensions */\n\ |
4655 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
4656 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
4657 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
4658 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
4659 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
4660 | }\n\n" |
4661 | ; else return |
4662 | "/* Default linker script, for normal executables */\n\ |
4663 | OUTPUT_FORMAT(\"elf64-x86-64\", \"elf64-x86-64\",\n\ |
4664 | \"elf64-x86-64\")\n\ |
4665 | OUTPUT_ARCH(i386:x86-64)\n\ |
4666 | ENTRY(_start)\n\ |
4667 | SEARCH_DIR(\"/usr/lib\");\n\ |
4668 | SECTIONS\n\ |
4669 | {\n\ |
4670 | /* Read-only sections, merged into text segment: */\n\ |
4671 | PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;\n\ |
4672 | .init :\n\ |
4673 | {\n\ |
4674 | KEEP (*(.init))\n\ |
4675 | } =0x090909090\n\ |
4676 | .plt : { *(.plt) }\n\ |
4677 | .text :\n\ |
4678 | {\n\ |
4679 | *(.text .stub .text.* .gnu.linkonce.t.*)\n\ |
4680 | KEEP (*(.text.*personality*))\n\ |
4681 | /* .gnu.warning sections are handled specially by elf32.em. */\n\ |
4682 | *(.gnu.warning)\n\ |
4683 | } =0xcccccccc\n\ |
4684 | .fini :\n\ |
4685 | {\n\ |
4686 | KEEP (*(.fini))\n" |
4687 | " } =0x090909090\n\ |
4688 | PROVIDE (__etext = .);\n\ |
4689 | PROVIDE (_etext = .);\n\ |
4690 | PROVIDE (etext = .);\n\ |
4691 | . = ALIGN(0x100000) + (. & (0x100000 - 1)) + 0 ;\n\ |
4692 | .interp : { *(.interp) }\n\ |
4693 | .hash : { *(.hash) }\n\ |
4694 | .gnu.hash : { *(.gnu.hash) }\n\ |
4695 | .dynsym : { *(.dynsym) }\n\ |
4696 | .dynstr : { *(.dynstr) }\n\ |
4697 | .gnu.version : { *(.gnu.version) }\n\ |
4698 | .gnu.version_d : { *(.gnu.version_d) }\n\ |
4699 | .gnu.version_r : { *(.gnu.version_r) }\n\ |
4700 | .rel.init : { *(.rel.init) }\n\ |
4701 | .rela.init : { *(.rela.init) }\n\ |
4702 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }\n\ |
4703 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }\n\ |
4704 | .rel.fini : { *(.rel.fini) }\n\ |
4705 | .rela.fini : { *(.rela.fini) }\n\ |
4706 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }\n\ |
4707 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }\n\ |
4708 | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }\n\ |
4709 | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }\n\ |
4710 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }\n\ |
4711 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }\n" |
4712 | " .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }\n\ |
4713 | .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }\n\ |
4714 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }\n\ |
4715 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }\n\ |
4716 | .rel.ctors : { *(.rel.ctors) }\n\ |
4717 | .rela.ctors : { *(.rela.ctors) }\n\ |
4718 | .rel.dtors : { *(.rel.dtors) }\n\ |
4719 | .rela.dtors : { *(.rela.dtors) }\n\ |
4720 | .rel.got : { *(.rel.got) }\n\ |
4721 | .rela.got : { *(.rela.got) }\n\ |
4722 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }\n\ |
4723 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }\n\ |
4724 | .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }\n\ |
4725 | .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }\n\ |
4726 | .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }\n\ |
4727 | .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }\n\ |
4728 | .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }\n\ |
4729 | .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }\n\ |
4730 | .rel.plt : { *(.rel.plt) }\n\ |
4731 | .rela.plt : { *(.rela.plt) }\n\ |
4732 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\n\ |
4733 | .rodata1 : { *(.rodata1) }\n\ |
4734 | .eh_frame_hdr : { *(.eh_frame_hdr) }\n\ |
4735 | .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\n\ |
4736 | .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\n" |
4737 | " /* Adjust the address for the data segment. We want to adjust up to\n\ |
4738 | the same address within the page on the next page up. */\n\ |
4739 | . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);\n\ |
4740 | PROVIDE_HIDDEN(__got_start = .);\n\ |
4741 | /* Exception handling */\n\ |
4742 | .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\n\ |
4743 | .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\n\ |
4744 | /* Thread Local Storage sections */\n\ |
4745 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\n\ |
4746 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\n\ |
4747 | .preinit_array :\n\ |
4748 | {\n\ |
4749 | PROVIDE_HIDDEN (__preinit_array_start = .);\n\ |
4750 | KEEP (*(.preinit_array))\n\ |
4751 | PROVIDE_HIDDEN (__preinit_array_end = .);\n\ |
4752 | }\n\ |
4753 | .init_array :\n\ |
4754 | {\n\ |
4755 | PROVIDE_HIDDEN (__init_array_start = .);\n\ |
4756 | KEEP (*(SORT(.init_array.*)))\n\ |
4757 | KEEP (*(.init_array))\n\ |
4758 | PROVIDE_HIDDEN (__init_array_end = .);\n\ |
4759 | }\n\ |
4760 | .fini_array :\n\ |
4761 | {\n" |
4762 | " PROVIDE_HIDDEN (__fini_array_start = .);\n\ |
4763 | KEEP (*(.fini_array))\n\ |
4764 | KEEP (*(SORT(.fini_array.*)))\n\ |
4765 | PROVIDE_HIDDEN (__fini_array_end = .);\n\ |
4766 | }\n\ |
4767 | .openbsd.randomdata :\n\ |
4768 | {\n\ |
4769 | *(.openbsd.randomdata .openbsd.randomdata.*)\n\ |
4770 | }\n\ |
4771 | .jcr : { KEEP (*(.jcr)) }\n\ |
4772 | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\n\ |
4773 | .dynamic : { *(.dynamic) }\n\ |
4774 | /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR\n\ |
4775 | are relocated here to receive the same mprotect protection as .got */\n\ |
4776 | . = DATA_SEGMENT_RELRO_END (0, .);\n\ |
4777 | .got : { *(.got.plt) *(.got) }\n\ |
4778 | .ctors :\n\ |
4779 | {\n\ |
4780 | /* gcc uses crtbegin.o to find the start of\n\ |
4781 | the constructors, so we make sure it is\n\ |
4782 | first. Because this is a wildcard, it\n\ |
4783 | doesn't matter if the user does not\n\ |
4784 | actually link against crtbegin.o; the\n\ |
4785 | linker won't look for a file to match a\n\ |
4786 | wildcard. The wildcard also means that it\n\ |
4787 | doesn't matter which directory crtbegin.o\n\ |
4788 | is in. */\n\ |
4789 | KEEP (*crtbegin*.o(.ctors))\n\ |
4790 | /* We don't want to include the .ctor section from\n\ |
4791 | the crtend.o file until after the sorted ctors.\n\ |
4792 | The .ctor section from the crtend file contains the\n\ |
4793 | end of ctors marker and it must be last */\n\ |
4794 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))\n\ |
4795 | KEEP (*(SORT(.ctors.*)))\n\ |
4796 | KEEP (*(.ctors))\n\ |
4797 | }\n\ |
4798 | .dtors :\n\ |
4799 | {\n\ |
4800 | KEEP (*crtbegin*.o(.dtors))\n\ |
4801 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))\n\ |
4802 | KEEP (*(SORT(.dtors.*)))\n\ |
4803 | KEEP (*(.dtors))\n\ |
4804 | }\n\ |
4805 | .gotpad1 : { __got_end = .;} . = ALIGN(0x100000) + (. & (0x100000 - 1));\n\ |
4806 | .data :\n\ |
4807 | {\n\ |
4808 | __data_start = . ;\n\ |
4809 | *(.data .data.* .gnu.linkonce.d.*)\n\ |
4810 | KEEP (*(.gnu.linkonce.d.*personality*))\n\ |
4811 | SORT(CONSTRUCTORS)\n\ |
4812 | }\n\ |
4813 | .data1 : { *(.data1) }\n\ |
4814 | _edata = .; PROVIDE (edata = .);\n\ |
4815 | __bss_start = .;\n\ |
4816 | .bss :\n\ |
4817 | {\n\ |
4818 | *(.dynbss)\n\ |
4819 | *(.bss .bss.* .gnu.linkonce.b.*)\n\ |
4820 | *(COMMON)\n\ |
4821 | /* Align here to ensure that the .bss section occupies space up to\n\ |
4822 | _end. Align after .bss to ensure correct alignment even if the\n\ |
4823 | .bss section disappears because there are no input sections.\n\ |
4824 | FIXME: Why do we need it? When there is no .bss section, we don't\n\ |
4825 | pad the .data section. */\n\ |
4826 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4827 | }\n\ |
4828 | . = ALIGN(64 / 8);\n\ |
4829 | .lbss :\n\ |
4830 | {\n\ |
4831 | *(.dynlbss)\n\ |
4832 | *(.lbss .lbss.* .gnu.linkonce.lb.*)\n\ |
4833 | *(LARGE_COMMON)\n\ |
4834 | }\n\ |
4835 | .lrodata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4836 | {\n\ |
4837 | *(.lrodata .lrodata.* .gnu.linkonce.lr.*)\n\ |
4838 | }\n\ |
4839 | .ldata ALIGN(0x100000) + (. & (0x100000 - 1)) :\n\ |
4840 | {\n\ |
4841 | *(.ldata .ldata.* .gnu.linkonce.l.*)\n\ |
4842 | . = ALIGN(. != 0 ? 64 / 8 : 1);\n\ |
4843 | }\n\ |
4844 | . = ALIGN(64 / 8);\n\ |
4845 | _end = .; PROVIDE (end = .);\n\ |
4846 | . = DATA_SEGMENT_END (.);\n\ |
4847 | /* Stabs debugging sections. */\n\ |
4848 | .stab 0 : { *(.stab) }\n\ |
4849 | .stabstr 0 : { *(.stabstr) }\n\ |
4850 | .stab.excl 0 : { *(.stab.excl) }\n\ |
4851 | .stab.exclstr 0 : { *(.stab.exclstr) }\n\ |
4852 | .stab.index 0 : { *(.stab.index) }\n\ |
4853 | .stab.indexstr 0 : { *(.stab.indexstr) }\n\ |
4854 | .comment 0 : { *(.comment) }\n\ |
4855 | /* DWARF debug sections.\n\ |
4856 | Symbols in the DWARF debugging sections are relative to the beginning\n\ |
4857 | of the section so we begin them at 0. */\n\ |
4858 | /* DWARF 1 */\n\ |
4859 | .debug 0 : { *(.debug) }\n\ |
4860 | .line 0 : { *(.line) }\n\ |
4861 | /* GNU DWARF 1 extensions */\n\ |
4862 | .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ |
4863 | .debug_sfnames 0 : { *(.debug_sfnames) }\n\ |
4864 | /* DWARF 1.1 and DWARF 2 */\n\ |
4865 | .debug_aranges 0 : { *(.debug_aranges) }\n\ |
4866 | .debug_pubnames 0 : { *(.debug_pubnames) }\n\ |
4867 | /* DWARF 2 */\n\ |
4868 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\n\ |
4869 | .debug_abbrev 0 : { *(.debug_abbrev) }\n\ |
4870 | .debug_line 0 : { *(.debug_line) }\n\ |
4871 | .debug_frame 0 : { *(.debug_frame) }\n\ |
4872 | .debug_str 0 : { *(.debug_str) }\n\ |
4873 | .debug_loc 0 : { *(.debug_loc) }\n\ |
4874 | .debug_macinfo 0 : { *(.debug_macinfo) }\n\ |
4875 | /* SGI/MIPS DWARF 2 extensions */\n\ |
4876 | .debug_weaknames 0 : { *(.debug_weaknames) }\n\ |
4877 | .debug_funcnames 0 : { *(.debug_funcnames) }\n\ |
4878 | .debug_typenames 0 : { *(.debug_typenames) }\n\ |
4879 | .debug_varnames 0 : { *(.debug_varnames) }\n\ |
4880 | /DISCARD/ : { *(.note.GNU-stack) }\n\ |
4881 | }\n\n" |
4882 | ; } |
4883 | |
4884 | #define OPTION_DISABLE_NEW_DTAGS(400) (400) |
4885 | #define OPTION_ENABLE_NEW_DTAGS((400) + 1) (OPTION_DISABLE_NEW_DTAGS(400) + 1) |
4886 | #define OPTION_GROUP(((400) + 1) + 1) (OPTION_ENABLE_NEW_DTAGS((400) + 1) + 1) |
4887 | #define OPTION_EH_FRAME_HDR((((400) + 1) + 1) + 1) (OPTION_GROUP(((400) + 1) + 1) + 1) |
4888 | #define OPTION_EXCLUDE_LIBS(((((400) + 1) + 1) + 1) + 1) (OPTION_EH_FRAME_HDR((((400) + 1) + 1) + 1) + 1) |
4889 | #define OPTION_HASH_STYLE((((((400) + 1) + 1) + 1) + 1) + 1) (OPTION_EXCLUDE_LIBS(((((400) + 1) + 1) + 1) + 1) + 1) |
4890 | |
4891 | static void |
4892 | gldelf_x86_64_obsd_add_options |
4893 | (int ns, char **shortopts, int nl, struct option **longopts, |
4894 | int nrl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), struct option **really_longopts ATTRIBUTE_UNUSED__attribute__ ((__unused__))) |
4895 | { |
4896 | static const char xtra_short[] = "z:"; |
4897 | static const struct option xtra_long[] = { |
4898 | {"disable-new-dtags", no_argument0, NULL((void*)0), OPTION_DISABLE_NEW_DTAGS(400)}, |
4899 | {"enable-new-dtags", no_argument0, NULL((void*)0), OPTION_ENABLE_NEW_DTAGS((400) + 1)}, |
4900 | {"eh-frame-hdr", no_argument0, NULL((void*)0), OPTION_EH_FRAME_HDR((((400) + 1) + 1) + 1)}, |
4901 | {"exclude-libs", required_argument1, NULL((void*)0), OPTION_EXCLUDE_LIBS(((((400) + 1) + 1) + 1) + 1)}, |
4902 | {"hash-style", required_argument1, NULL((void*)0), OPTION_HASH_STYLE((((((400) + 1) + 1) + 1) + 1) + 1)}, |
4903 | {"Bgroup", no_argument0, NULL((void*)0), OPTION_GROUP(((400) + 1) + 1)}, |
4904 | {NULL((void*)0), no_argument0, NULL((void*)0), 0} |
4905 | }; |
4906 | |
4907 | *shortopts = (char *) xrealloc (*shortopts, ns + sizeof (xtra_short)); |
4908 | memcpy (*shortopts + ns, &xtra_short, sizeof (xtra_short)); |
4909 | *longopts = (struct option *) |
4910 | xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long)); |
4911 | memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long)); |
4912 | } |
4913 | |
4914 | static bfd_boolean |
4915 | gldelf_x86_64_obsd_handle_option (int optc) |
4916 | { |
4917 | switch (optc) |
4918 | { |
4919 | default: |
4920 | return FALSE0; |
4921 | |
4922 | case OPTION_DISABLE_NEW_DTAGS(400): |
4923 | link_info.new_dtags = FALSE0; |
4924 | break; |
4925 | |
4926 | case OPTION_ENABLE_NEW_DTAGS((400) + 1): |
4927 | link_info.new_dtags = TRUE1; |
4928 | break; |
4929 | |
4930 | case OPTION_EH_FRAME_HDR((((400) + 1) + 1) + 1): |
4931 | link_info.eh_frame_hdr = TRUE1; |
4932 | break; |
4933 | |
4934 | case OPTION_GROUP(((400) + 1) + 1): |
4935 | link_info.flags_1 |= (bfd_vma) DF_1_GROUP0x00000004; |
4936 | /* Groups must be self-contained. */ |
4937 | link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; |
4938 | link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR; |
4939 | break; |
4940 | |
4941 | case OPTION_EXCLUDE_LIBS(((((400) + 1) + 1) + 1) + 1): |
4942 | add_excluded_libs (optarg); |
4943 | break; |
4944 | |
4945 | case OPTION_HASH_STYLE((((((400) + 1) + 1) + 1) + 1) + 1): |
4946 | #ifndef __mips64__ |
4947 | link_info.emit_hash = FALSE0; |
4948 | link_info.emit_gnu_hash = FALSE0; |
4949 | if (strcmp (optarg, "sysv") == 0) |
4950 | link_info.emit_hash = TRUE1; |
4951 | else if (strcmp (optarg, "gnu") == 0) |
4952 | link_info.emit_gnu_hash = TRUE1; |
4953 | else if (strcmp (optarg, "both") == 0) |
4954 | { |
4955 | link_info.emit_hash = TRUE1; |
4956 | link_info.emit_gnu_hash = TRUE1; |
4957 | } |
4958 | else |
4959 | einfo (_("%P%F: invalid hash style `%s'\n")("%P%F: invalid hash style `%s'\n"), optarg); |
4960 | #endif |
4961 | break; |
4962 | |
4963 | case 'z': |
4964 | if (strcmp (optarg, "initfirst") == 0) |
4965 | link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST0x00000020; |
4966 | else if (strcmp (optarg, "interpose") == 0) |
4967 | link_info.flags_1 |= (bfd_vma) DF_1_INTERPOSE0x00000400; |
4968 | else if (strcmp (optarg, "loadfltr") == 0) |
4969 | link_info.flags_1 |= (bfd_vma) DF_1_LOADFLTR0x00000010; |
4970 | else if (strcmp (optarg, "nodefaultlib") == 0) |
4971 | link_info.flags_1 |= (bfd_vma) DF_1_NODEFLIB0x00000800; |
4972 | else if (strcmp (optarg, "nodelete") == 0) |
4973 | link_info.flags_1 |= (bfd_vma) DF_1_NODELETE0x00000008; |
4974 | else if (strcmp (optarg, "nodlopen") == 0) |
4975 | link_info.flags_1 |= (bfd_vma) DF_1_NOOPEN0x00000040; |
4976 | else if (strcmp (optarg, "nodump") == 0) |
4977 | link_info.flags_1 |= (bfd_vma) DF_1_NODUMP0x00001000; |
4978 | else if (strcmp (optarg, "now") == 0) |
4979 | { |
4980 | link_info.flags |= (bfd_vma) DF_BIND_NOW(1 << 3); |
4981 | link_info.flags_1 |= (bfd_vma) DF_1_NOW0x00000001; |
4982 | } |
4983 | else if (strcmp (optarg, "origin") == 0) |
4984 | { |
4985 | link_info.flags |= (bfd_vma) DF_ORIGIN(1 << 0); |
4986 | link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN0x00000080; |
4987 | } |
4988 | else if (strcmp (optarg, "defs") == 0) |
4989 | link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; |
4990 | else if (strcmp (optarg, "muldefs") == 0) |
4991 | link_info.allow_multiple_definition = TRUE1; |
4992 | else if (strcmp (optarg, "combreloc") == 0) |
4993 | link_info.combreloc = TRUE1; |
4994 | else if (strcmp (optarg, "nocombreloc") == 0) |
4995 | link_info.combreloc = FALSE0; |
4996 | else if (strcmp (optarg, "nocopyreloc") == 0) |
4997 | link_info.nocopyreloc = TRUE1; |
4998 | else if (strcmp (optarg, "execstack") == 0) |
4999 | { |
5000 | link_info.execstack = TRUE1; |
5001 | link_info.noexecstack = FALSE0; |
5002 | } |
5003 | else if (strcmp (optarg, "noexecstack") == 0) |
5004 | { |
5005 | link_info.noexecstack = TRUE1; |
5006 | link_info.execstack = FALSE0; |
5007 | } |
5008 | else if (strcmp (optarg, "relro") == 0) |
5009 | link_info.relro = TRUE1; |
5010 | else if (strcmp (optarg, "norelro") == 0) |
5011 | link_info.relro = FALSE0; |
5012 | else if (strcmp (optarg, "wxneeded") == 0) |
5013 | link_info.wxneeded = TRUE1; |
5014 | else if (strcmp (optarg, "notext") == 0) |
5015 | link_info.allow_textrel = TRUE1; |
5016 | else if (strcmp (optarg, "text") == 0) |
5017 | link_info.allow_textrel = FALSE0; |
5018 | /* What about the other Solaris -z options? FIXME. */ |
5019 | break; |
5020 | } |
5021 | |
5022 | return TRUE1; |
5023 | } |
5024 | |
5025 | |
5026 | static void |
5027 | gldelf_x86_64_obsd_list_options (FILE * file) |
5028 | { |
5029 | fprintf (file, _(" -Bgroup\t\tSelects group name lookup rules for DSO\n")(" -Bgroup\t\tSelects group name lookup rules for DSO\n")); |
5030 | fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n")(" --disable-new-dtags\tDisable new dynamic tags\n")); |
5031 | fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n")(" --enable-new-dtags\tEnable new dynamic tags\n")); |
5032 | fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n")(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n")); |
5033 | fprintf (file, _(" --hash-style=STYLE\tSet hash style to sysv, gnu or both\n")(" --hash-style=STYLE\tSet hash style to sysv, gnu or both\n" )); |
5034 | fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n")(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n" )); |
5035 | fprintf (file, _(" -z defs\t\tReport unresolved symbols in object files.\n")(" -z defs\t\tReport unresolved symbols in object files.\n")); |
5036 | fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n")(" -z execstack\t\tMark executable as requiring executable stack\n" )); |
5037 | fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n")(" -z initfirst\t\tMark DSO to be initialized first at runtime\n" )); |
5038 | fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n")(" -z interpose\t\tMark object to interpose all DSOs but executable\n" )); |
5039 | fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n")(" -z loadfltr\t\tMark object requiring immediate process\n" )); |
5040 | fprintf (file, _(" -z muldefs\t\tAllow multiple definitions\n")(" -z muldefs\t\tAllow multiple definitions\n")); |
5041 | fprintf (file, _(" -z nocombreloc\tDon't merge dynamic relocs into one section\n")(" -z nocombreloc\tDon't merge dynamic relocs into one section\n" )); |
5042 | fprintf (file, _(" -z nocopyreloc\tDon't create copy relocs\n")(" -z nocopyreloc\tDon't create copy relocs\n")); |
5043 | fprintf (file, _(" -z nodefaultlib\tMark object not to use default search paths\n")(" -z nodefaultlib\tMark object not to use default search paths\n" )); |
5044 | fprintf (file, _(" -z nodelete\t\tMark DSO non-deletable at runtime\n")(" -z nodelete\t\tMark DSO non-deletable at runtime\n")); |
5045 | fprintf (file, _(" -z nodlopen\t\tMark DSO not available to dlopen\n")(" -z nodlopen\t\tMark DSO not available to dlopen\n")); |
5046 | fprintf (file, _(" -z nodump\t\tMark DSO not available to dldump\n")(" -z nodump\t\tMark DSO not available to dldump\n")); |
5047 | fprintf (file, _(" -z noexecstack\tMark executable as not requiring executable stack\n")(" -z noexecstack\tMark executable as not requiring executable stack\n" )); |
5048 | fprintf (file, _(" -z norelro\t\tDon't create RELRO program header\n")(" -z norelro\t\tDon't create RELRO program header\n")); |
5049 | fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n")(" -z now\t\tMark object non-lazy runtime binding\n")); |
5050 | fprintf (file, _(" -z origin\t\tMark object requiring immediate $ORIGIN processing\n\t\t\t at runtime\n")(" -z origin\t\tMark object requiring immediate $ORIGIN processing\n\t\t\t at runtime\n" )); |
5051 | fprintf (file, _(" -z relro\t\tCreate RELRO program header\n")(" -z relro\t\tCreate RELRO program header\n")); |
5052 | fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n")(" -z KEYWORD\t\tIgnored for Solaris compatibility\n")); |
5053 | } |
5054 | |
5055 | struct ld_emulation_xfer_struct ld_elf_x86_64_obsd_emulation = |
5056 | { |
5057 | gldelf_x86_64_obsd_before_parse, |
5058 | syslib_default, |
5059 | hll_default, |
5060 | after_parse_default, |
5061 | gldelf_x86_64_obsd_after_open, |
5062 | after_allocation_default, |
5063 | set_output_arch_default, |
5064 | ldemul_default_target, |
5065 | gldelf_x86_64_obsd_before_allocation, |
5066 | gldelf_x86_64_obsd_get_script, |
5067 | "elf_x86_64_obsd", |
5068 | "elf64-x86-64", |
5069 | gldelf_x86_64_obsd_finish, |
5070 | NULL((void*)0), |
5071 | gldelf_x86_64_obsd_open_dynamic_archive, |
5072 | gldelf_x86_64_obsd_place_orphan, |
5073 | NULL((void*)0), |
5074 | NULL((void*)0), |
5075 | gldelf_x86_64_obsd_add_options, |
5076 | gldelf_x86_64_obsd_handle_option, |
5077 | NULL((void*)0), |
5078 | gldelf_x86_64_obsd_list_options, |
5079 | gldelf_x86_64_obsd_load_symbols, |
5080 | NULL((void*)0), |
5081 | NULL((void*)0) |
5082 | }; |