1 # This shell script emits a C file. -*- C -*-
2 # Copyright (C) 2002-2016 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 # This file is sourced from elf32.em, and defines extra powerpc64-elf
29 #include "elf64-ppc.h"
31 #include "elf/ppc64.h"
33 static asection *ppc_add_stub_section (const char *, asection *);
34 static void ppc_layout_sections_again (void);
36 static struct ppc64_elf_params params = { NULL,
37 &ppc_add_stub_section,
38 &ppc_layout_sections_again,
40 ${DEFAULT_PLT_STATIC_CHAIN-0}, -1, 0,
43 /* Fake input file for stubs. */
44 static lang_input_statement_type *stub_file;
46 /* Whether we need to call ppc_layout_sections_again. */
47 static int need_laying_out = 0;
49 /* Whether to add ".foo" entries for each "foo" in a version script. */
50 static int dotsyms = 1;
52 /* Whether to run tls optimization. */
53 static int no_tls_opt = 0;
55 /* Whether to run opd optimization. */
56 static int no_opd_opt = 0;
58 /* Whether to run toc optimization. */
59 static int no_toc_opt = 0;
61 /* Whether to sort input toc and got sections. */
62 static int no_toc_sort = 0;
64 /* Input .toc sections will be placed in this output section. */
65 static const char *toc_section_name = ".got";
66 static asection *toc_section = 0;
68 /* This is called before the input files are opened. We create a new
69 fake input file to hold the stub sections. */
72 ppc_create_output_section_statements (void)
74 if (!(bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
75 && elf_object_id (link_info.output_bfd) == PPC64_ELF_DATA))
78 link_info.wrap_char = '.';
80 stub_file = lang_add_input_file ("linker stubs",
81 lang_input_file_is_fake_enum,
83 stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd);
84 if (stub_file->the_bfd == NULL
85 || !bfd_set_arch_mach (stub_file->the_bfd,
86 bfd_get_arch (link_info.output_bfd),
87 bfd_get_mach (link_info.output_bfd)))
89 einfo ("%F%P: can not create BFD: %E\n");
93 stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
94 ldlang_add_file (stub_file);
95 params.stub_bfd = stub_file->the_bfd;
96 if (params.save_restore_funcs < 0)
97 params.save_restore_funcs = !bfd_link_relocatable (&link_info);
98 if (!ppc64_elf_init_stub_bfd (&link_info, ¶ms))
99 einfo ("%F%P: can not init BFD: %E\n");
102 /* Called after opening files but before mapping sections. */
105 ppc_after_open (void)
107 if (stub_file != NULL && link_info.relro && params.object_in_toc)
109 /* We have a .toc section that might be written to at run time.
110 Don't put .toc into the .got output section. */
111 lang_output_section_statement_type *got;
113 got = lang_output_section_find (".got");
116 lang_statement_union_type *s;
117 for (s = got->children.head; s != NULL; s = s->header.next)
118 if (s->header.type == lang_wild_statement_enum
119 && s->wild_statement.filename == NULL)
121 struct wildcard_list **i = &s->wild_statement.section_list;
123 if (strcmp ((*i)->spec.name, ".toc") == 0)
128 /* Instead, .toc input sections will be mapped to the
129 read/write .toc output section. If user scripts don't
130 provide one then we'll lose toc sorting and multi-toc. */
131 toc_section_name = ".toc";
134 gld${EMULATION_NAME}_after_open ();
137 /* Move the input section statement at *U which happens to be on LIST
138 to be just before *TO. */
141 move_input_section (lang_statement_list_type *list,
142 lang_statement_union_type **u,
143 lang_statement_union_type **to)
145 lang_statement_union_type *s = *u;
146 asection *i = s->input_section.section;
149 /* Snip the input section from the statement list. If it was the
150 last statement, fix the list tail pointer. */
154 /* Add it back in the new position. */
155 s->header.next = *to;
157 if (list->tail == to)
158 list->tail = &s->header.next;
160 /* Trim I off the bfd map_head/map_tail doubly linked lists. */
163 (p != NULL ? p : i->output_section)->map_head.s = n;
164 (n != NULL ? n : i->output_section)->map_tail.s = p;
166 /* Add I back on in its new position. */
167 if (s->header.next->header.type == lang_input_section_enum)
169 n = s->header.next->input_section.section;
174 /* If the next statement is not an input section statement then
175 TO must point at the previous input section statement
176 header.next field. */
177 lang_input_section_type *prev = (lang_input_section_type *)
178 ((char *) to - offsetof (lang_statement_union_type, header.next));
180 ASSERT (prev->header.type == lang_input_section_enum);
186 (p != NULL ? p : i->output_section)->map_head.s = i;
187 (n != NULL ? n : i->output_section)->map_tail.s = i;
190 /* Sort input section statements in the linker script tree rooted at
191 LIST so that those whose owning bfd happens to have a section
192 called .init or .fini are placed first. Place any TOC sections
193 referenced by small TOC relocs next, with TOC sections referenced
194 only by bigtoc relocs last. */
197 sort_toc_sections (lang_statement_list_type *list,
198 lang_statement_union_type **ini,
199 lang_statement_union_type **small)
201 lang_statement_union_type *s, **u;
205 while ((s = *u) != NULL)
207 switch (s->header.type)
209 case lang_wild_statement_enum:
210 sort_toc_sections (&s->wild_statement.children, ini, small);
213 case lang_group_statement_enum:
214 sort_toc_sections (&s->group_statement.children, ini, small);
217 case lang_input_section_enum:
218 i = s->input_section.section;
219 /* Leave the stub_file .got where it is. We put the .got
221 if (i->owner == stub_file->the_bfd)
223 if (bfd_get_section_by_name (i->owner, ".init") != NULL
224 || bfd_get_section_by_name (i->owner, ".fini") != NULL)
226 if (ini != NULL && *ini != s)
228 move_input_section (list, u, ini);
230 small = &s->header.next;
231 ini = &s->header.next;
235 small = &s->header.next;
236 ini = &s->header.next;
239 else if (ini == NULL)
242 if (ppc64_elf_has_small_toc_reloc (i))
244 if (small != NULL && *small != s)
246 move_input_section (list, u, small);
247 small = &s->header.next;
250 small = &s->header.next;
252 else if (small == NULL)
264 prelim_size_sections (void)
266 if (expld.phase != lang_mark_phase_enum)
268 expld.phase = lang_mark_phase_enum;
269 expld.dataseg.phase = exp_dataseg_none;
270 one_lang_size_sections_pass (NULL, FALSE);
271 /* We must not cache anything from the preliminary sizing. */
272 lang_reset_memory_regions ();
277 ppc_before_allocation (void)
279 if (stub_file != NULL)
282 && !ppc64_elf_edit_opd (&link_info))
283 einfo ("%X%P: can not edit %s: %E\n", "opd");
285 if (ppc64_elf_tls_setup (&link_info)
288 /* Size the sections. This is premature, but we want to know the
289 TLS segment layout so that certain optimizations can be done. */
290 prelim_size_sections ();
292 if (!ppc64_elf_tls_optimize (&link_info))
293 einfo ("%X%P: TLS problem %E\n");
297 && !bfd_link_relocatable (&link_info))
299 prelim_size_sections ();
301 if (!ppc64_elf_edit_toc (&link_info))
302 einfo ("%X%P: can not edit %s: %E\n", "toc");
307 lang_output_section_statement_type *toc_os;
309 toc_os = lang_output_section_find (toc_section_name);
311 sort_toc_sections (&toc_os->children, NULL, NULL);
315 gld${EMULATION_NAME}_before_allocation ();
318 struct hook_stub_info
320 lang_statement_list_type add;
321 asection *input_section;
324 /* Traverse the linker tree to find the spot where the stub goes. */
327 hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
329 lang_statement_union_type *l;
332 for (; (l = *lp) != NULL; lp = &l->header.next)
334 switch (l->header.type)
336 case lang_constructors_statement_enum:
337 ret = hook_in_stub (info, &constructor_list.head);
342 case lang_output_section_statement_enum:
343 ret = hook_in_stub (info,
344 &l->output_section_statement.children.head);
349 case lang_wild_statement_enum:
350 ret = hook_in_stub (info, &l->wild_statement.children.head);
355 case lang_group_statement_enum:
356 ret = hook_in_stub (info, &l->group_statement.children.head);
361 case lang_input_section_enum:
362 if (l->input_section.section == info->input_section)
364 /* We've found our section. Insert the stub immediately
365 before its associated input section. */
366 *lp = info->add.head;
367 *(info->add.tail) = l;
372 case lang_data_statement_enum:
373 case lang_reloc_statement_enum:
374 case lang_object_symbols_statement_enum:
375 case lang_output_statement_enum:
376 case lang_target_statement_enum:
377 case lang_input_statement_enum:
378 case lang_assignment_statement_enum:
379 case lang_padding_statement_enum:
380 case lang_address_statement_enum:
381 case lang_fill_statement_enum:
393 /* Call-back for ppc64_elf_size_stubs. */
395 /* Create a new stub section, and arrange for it to be linked
396 immediately before INPUT_SECTION. */
399 ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
403 asection *output_section;
404 lang_output_section_statement_type *os;
405 struct hook_stub_info info;
407 flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
408 | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_KEEP);
409 stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd,
410 stub_sec_name, flags);
412 || !bfd_set_section_alignment (stub_file->the_bfd, stub_sec,
413 (params.plt_stub_align > 5
414 ? params.plt_stub_align
418 output_section = input_section->output_section;
419 os = lang_output_section_get (output_section);
421 info.input_section = input_section;
422 lang_list_init (&info.add);
423 lang_add_section (&info.add, stub_sec, NULL, os);
425 if (info.add.head == NULL)
428 if (hook_in_stub (&info, &os->children.head))
432 einfo ("%X%P: can not make stub section: %E\n");
437 /* Another call-back for ppc64_elf_size_stubs. */
440 ppc_layout_sections_again (void)
442 /* If we have changed sizes of the stub sections, then we need
443 to recalculate all the section offsets. This may mean we need to
444 add even more stubs. */
445 gld${EMULATION_NAME}_map_segments (TRUE);
447 if (!bfd_link_relocatable (&link_info))
448 ppc64_elf_set_toc (&link_info, link_info.output_bfd);
450 need_laying_out = -1;
455 build_toc_list (lang_statement_union_type *statement)
457 if (statement->header.type == lang_input_section_enum)
459 asection *i = statement->input_section.section;
461 if (i->sec_info_type != SEC_INFO_TYPE_JUST_SYMS
462 && (i->flags & SEC_EXCLUDE) == 0
463 && i->output_section == toc_section)
465 if (!ppc64_elf_next_toc_section (&link_info, i))
466 einfo ("%X%P: linker script separates .got and .toc\n");
473 build_section_lists (lang_statement_union_type *statement)
475 if (statement->header.type == lang_input_section_enum)
477 asection *i = statement->input_section.section;
479 if (!((lang_input_statement_type *) i->owner->usrdata)->flags.just_syms
480 && (i->flags & SEC_EXCLUDE) == 0
481 && i->output_section != NULL
482 && i->output_section->owner == link_info.output_bfd)
484 if (!ppc64_elf_next_input_section (&link_info, i))
485 einfo ("%X%P: can not size stub section: %E\n");
491 /* Call the back-end function to set TOC base after we have placed all
494 gld${EMULATION_NAME}_after_allocation (void)
498 /* If generating a relocatable output file, then we don't have any
500 if (stub_file != NULL && !bfd_link_relocatable (&link_info))
502 ret = ppc64_elf_setup_section_lists (&link_info);
504 einfo ("%X%P: can not size stub section: %E\n");
507 ppc64_elf_start_multitoc_partition (&link_info);
509 if (!params.no_multi_toc)
511 toc_section = bfd_get_section_by_name (link_info.output_bfd,
513 if (toc_section != NULL)
514 lang_for_each_statement (build_toc_list);
517 if (ppc64_elf_layout_multitoc (&link_info)
518 && !params.no_multi_toc
519 && toc_section != NULL)
520 lang_for_each_statement (build_toc_list);
522 ppc64_elf_finish_multitoc_partition (&link_info);
524 lang_for_each_statement (build_section_lists);
526 if (!ppc64_elf_check_init_fini (&link_info))
527 einfo ("%P: .init/.fini fragments use differing TOC pointers\n");
529 /* Call into the BFD backend to do the real work. */
530 if (!ppc64_elf_size_stubs (&link_info))
531 einfo ("%X%P: can not size stub section: %E\n");
535 /* We can't parse and merge .eh_frame until the glink .eh_frame has
536 been generated. Otherwise the glink .eh_frame CIE won't be
537 merged with other CIEs, and worse, the glink .eh_frame FDEs won't
538 be listed in .eh_frame_hdr. */
539 ret = bfd_elf_discard_info (link_info.output_bfd, &link_info);
542 einfo ("%X%P: .eh_frame/.stab edit: %E\n");
548 /* Call map_segments regardless of the state of need_laying_out.
549 need_laying_out set to -1 means we have just laid everything out,
550 but ppc64_elf_size_stubs strips .branch_lt and .eh_frame if
551 unneeded, after ppc_layout_sections_again. Another call removes
552 these sections from the segment map. Their presence is
553 innocuous except for confusing ELF_SECTION_IN_SEGMENT. */
554 gld${EMULATION_NAME}_map_segments (need_laying_out > 0);
556 if (need_laying_out != -1 && !bfd_link_relocatable (&link_info))
557 ppc64_elf_set_toc (&link_info, link_info.output_bfd);
561 /* Final emulation specific call. */
564 gld${EMULATION_NAME}_finish (void)
567 char *line, *endline;
569 /* e_entry on PowerPC64 points to the function descriptor for
570 _start. If _start is missing, default to the first function
571 descriptor in the .opd section. */
572 if (stub_file != NULL
573 && (elf_elfheader (link_info.output_bfd)->e_flags & EF_PPC64_ABI) == 1)
574 entry_section = ".opd";
576 if (params.emit_stub_syms < 0)
577 params.emit_stub_syms = 1;
578 if (stub_file != NULL
579 && !bfd_link_relocatable (&link_info)
580 && !ppc64_elf_build_stubs (&link_info, config.stats ? &msg : NULL))
581 einfo ("%X%P: can not build stubs: %E\n");
584 for (line = msg; line != NULL; line = endline)
586 endline = strchr (line, '\n');
589 fprintf (stderr, "%s: %s\n", program_name, line);
595 ppc64_elf_restore_symbols (&link_info);
600 /* Add a pattern matching ".foo" for every "foo" in a version script.
602 The reason for doing this is that many shared library version
603 scripts export a selected set of functions or data symbols, forcing
608 . this; that; some; thing;
613 To make the above work for PowerPC64, we need to export ".this",
614 ".that" and so on, otherwise only the function descriptor syms are
615 exported. Lack of an exported function code sym may cause a
616 definition to be pulled in from a static library. */
618 static struct bfd_elf_version_expr *
619 gld${EMULATION_NAME}_new_vers_pattern (struct bfd_elf_version_expr *entry)
621 struct bfd_elf_version_expr *dot_entry;
626 || entry->pattern[0] == '.'
627 || (!entry->literal && entry->pattern[0] == '*'))
630 dot_entry = xmalloc (sizeof *dot_entry);
632 dot_entry->next = entry;
633 len = strlen (entry->pattern) + 2;
634 dot_pat = xmalloc (len);
636 memcpy (dot_pat + 1, entry->pattern, len - 1);
637 dot_entry->pattern = dot_pat;
638 dot_entry->script = 1;
643 /* Avoid processing the fake stub_file in vercheck, stat_needed and
644 check_needed routines. */
646 static void (*real_func) (lang_input_statement_type *);
648 static void ppc_for_each_input_file_wrapper (lang_input_statement_type *l)
655 ppc_lang_for_each_input_file (void (*func) (lang_input_statement_type *))
658 lang_for_each_input_file (&ppc_for_each_input_file_wrapper);
661 #define lang_for_each_input_file ppc_lang_for_each_input_file
665 if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
667 /* Special handling for embedded SPU executables. */
668 extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *);
669 static bfd_boolean gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *);
672 ppc64_recognized_file (lang_input_statement_type *entry)
674 if (embedded_spu_file (entry, "-m64"))
677 return gld${EMULATION_NAME}_load_symbols (entry);
680 LDEMUL_RECOGNIZED_FILE=ppc64_recognized_file
683 # Define some shell vars to insert bits of code into the standard elf
684 # parse_args and list_options functions.
686 PARSE_AND_LIST_PROLOGUE=${PARSE_AND_LIST_PROLOGUE}'
687 #define OPTION_STUBGROUP_SIZE 321
688 #define OPTION_PLT_STATIC_CHAIN (OPTION_STUBGROUP_SIZE + 1)
689 #define OPTION_NO_PLT_STATIC_CHAIN (OPTION_PLT_STATIC_CHAIN + 1)
690 #define OPTION_PLT_THREAD_SAFE (OPTION_NO_PLT_STATIC_CHAIN + 1)
691 #define OPTION_NO_PLT_THREAD_SAFE (OPTION_PLT_THREAD_SAFE + 1)
692 #define OPTION_PLT_ALIGN (OPTION_NO_PLT_THREAD_SAFE + 1)
693 #define OPTION_NO_PLT_ALIGN (OPTION_PLT_ALIGN + 1)
694 #define OPTION_STUBSYMS (OPTION_NO_PLT_ALIGN + 1)
695 #define OPTION_NO_STUBSYMS (OPTION_STUBSYMS + 1)
696 #define OPTION_SAVRES (OPTION_NO_STUBSYMS + 1)
697 #define OPTION_NO_SAVRES (OPTION_SAVRES + 1)
698 #define OPTION_DOTSYMS (OPTION_NO_SAVRES + 1)
699 #define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1)
700 #define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1)
701 #define OPTION_TLS_GET_ADDR_OPT (OPTION_NO_TLS_OPT + 1)
702 #define OPTION_NO_TLS_GET_ADDR_OPT (OPTION_TLS_GET_ADDR_OPT + 1)
703 #define OPTION_NO_OPD_OPT (OPTION_NO_TLS_GET_ADDR_OPT + 1)
704 #define OPTION_NO_TOC_OPT (OPTION_NO_OPD_OPT + 1)
705 #define OPTION_NO_MULTI_TOC (OPTION_NO_TOC_OPT + 1)
706 #define OPTION_NO_TOC_SORT (OPTION_NO_MULTI_TOC + 1)
707 #define OPTION_NON_OVERLAPPING_OPD (OPTION_NO_TOC_SORT + 1)
710 PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
711 { "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
712 { "plt-static-chain", no_argument, NULL, OPTION_PLT_STATIC_CHAIN },
713 { "no-plt-static-chain", no_argument, NULL, OPTION_NO_PLT_STATIC_CHAIN },
714 { "plt-thread-safe", no_argument, NULL, OPTION_PLT_THREAD_SAFE },
715 { "no-plt-thread-safe", no_argument, NULL, OPTION_NO_PLT_THREAD_SAFE },
716 { "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN },
717 { "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN },
718 { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
719 { "no-emit-stub-syms", no_argument, NULL, OPTION_NO_STUBSYMS },
720 { "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
721 { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
722 { "save-restore-funcs", no_argument, NULL, OPTION_SAVRES },
723 { "no-save-restore-funcs", no_argument, NULL, OPTION_NO_SAVRES },
724 { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
725 { "tls-get-addr-optimize", no_argument, NULL, OPTION_TLS_GET_ADDR_OPT },
726 { "no-tls-get-addr-optimize", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_OPT },
727 { "no-opd-optimize", no_argument, NULL, OPTION_NO_OPD_OPT },
728 { "no-toc-optimize", no_argument, NULL, OPTION_NO_TOC_OPT },
729 { "no-multi-toc", no_argument, NULL, OPTION_NO_MULTI_TOC },
730 { "no-toc-sort", no_argument, NULL, OPTION_NO_TOC_SORT },
731 { "non-overlapping-opd", no_argument, NULL, OPTION_NON_OVERLAPPING_OPD },
734 PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'
736 --stub-group-size=N Maximum size of a group of input sections that\n\
737 can be handled by one stub section. A negative\n\
738 value locates all stubs before their branches\n\
739 (with a group size of -N), while a positive\n\
740 value allows two groups of input sections, one\n\
741 before, and one after each stub section.\n\
742 Values of +/-1 indicate the linker should\n\
743 choose suitable defaults.\n"
746 --plt-static-chain PLT call stubs should load r11.${DEFAULT_PLT_STATIC_CHAIN- (default)}\n"
749 --no-plt-static-chain PLT call stubs should not load r11.${DEFAULT_PLT_STATIC_CHAIN+ (default)}\n"
752 --plt-thread-safe PLT call stubs with load-load barrier.\n"
755 --no-plt-thread-safe PLT call stubs without barrier.\n"
758 --plt-align [=<align>] Align PLT call stubs to fit cache lines.\n"
761 --no-plt-align Dont'\''t align individual PLT call stubs.\n"
764 --emit-stub-syms Label linker stubs with a symbol.\n"
767 --no-emit-stub-syms Don'\''t label linker stubs with a symbol.\n"
770 --dotsyms For every version pattern \"foo\" in a version\n\
771 script, add \".foo\" so that function code\n\
772 symbols are treated the same as function\n\
773 descriptor symbols. Defaults to on.\n"
776 --no-dotsyms Don'\''t do anything special in version scripts.\n"
779 --save-restore-funcs Provide register save and restore routines used\n\
780 by gcc -Os code. Defaults to on for normal\n\
781 final link, off for ld -r.\n"
784 --no-save-restore-funcs Don'\''t provide these routines.\n"
787 --no-tls-optimize Don'\''t try to optimize TLS accesses.\n"
790 --tls-get-addr-optimize Force use of special __tls_get_addr call.\n"
793 --no-tls-get-addr-optimize Don'\''t use a special __tls_get_addr call.\n"
796 --no-opd-optimize Don'\''t optimize the OPD section.\n"
799 --no-toc-optimize Don'\''t optimize the TOC section.\n"
802 --no-multi-toc Disallow automatic multiple toc sections.\n"
805 --no-toc-sort Don'\''t sort TOC and GOT sections.\n"
808 --non-overlapping-opd Canonicalize .opd, so that there are no\n\
809 overlapping .opd entries.\n"
813 PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
814 case OPTION_STUBGROUP_SIZE:
817 params.group_size = bfd_scan_vma (optarg, &end, 0);
819 einfo (_("%P%F: invalid number `%s'\''\n"), optarg);
823 case OPTION_PLT_STATIC_CHAIN:
824 params.plt_static_chain = 1;
827 case OPTION_NO_PLT_STATIC_CHAIN:
828 params.plt_static_chain = 0;
831 case OPTION_PLT_THREAD_SAFE:
832 params.plt_thread_safe = 1;
835 case OPTION_NO_PLT_THREAD_SAFE:
836 params.plt_thread_safe = 0;
839 case OPTION_PLT_ALIGN:
843 unsigned long val = strtoul (optarg, &end, 0);
845 einfo (_("%P%F: invalid --plt-align `%s'\''\n"), optarg);
846 params.plt_stub_align = val;
849 params.plt_stub_align = 5;
852 case OPTION_NO_PLT_ALIGN:
853 params.plt_stub_align = 0;
856 case OPTION_STUBSYMS:
857 params.emit_stub_syms = 1;
860 case OPTION_NO_STUBSYMS:
861 params.emit_stub_syms = 0;
868 case OPTION_NO_DOTSYMS:
873 params.save_restore_funcs = 1;
876 case OPTION_NO_SAVRES:
877 params.save_restore_funcs = 0;
880 case OPTION_NO_TLS_OPT:
884 case OPTION_TLS_GET_ADDR_OPT:
885 params.tls_get_addr_opt = 1;
888 case OPTION_NO_TLS_GET_ADDR_OPT:
889 params.tls_get_addr_opt = 0;
892 case OPTION_NO_OPD_OPT:
896 case OPTION_NO_TOC_OPT:
900 case OPTION_NO_MULTI_TOC:
901 params.no_multi_toc = 1;
904 case OPTION_NO_TOC_SORT:
908 case OPTION_NON_OVERLAPPING_OPD:
909 params.non_overlapping_opd = 1;
912 case OPTION_TRADITIONAL_FORMAT:
914 params.tls_get_addr_opt = 0;
917 params.no_multi_toc = 1;
919 params.plt_static_chain = 1;
923 # Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation
925 LDEMUL_NEW_VERS_PATTERN=gld${EMULATION_NAME}_new_vers_pattern
926 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements
927 LDEMUL_AFTER_OPEN=ppc_after_open
928 LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
929 LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
930 LDEMUL_FINISH=gld${EMULATION_NAME}_finish