1 # This shell script emits a C file. -*- C -*-
2 # Copyright (C) 2002-2024 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 elf.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);
35 static void ppc_edit (void);
37 static struct ppc64_elf_params params = { NULL,
38 &ppc_add_stub_section,
39 &ppc_layout_sections_again,
42 ${DEFAULT_PLT_STATIC_CHAIN-0}, -1, 5,
43 -1, -1, 0, 0, -1, -1, 0};
45 /* Fake input file for stubs. */
46 static lang_input_statement_type *stub_file;
48 /* Whether we need to call ppc_layout_sections_again. */
49 static int need_laying_out = 0;
51 /* Whether to add ".foo" entries for each "foo" in a version script. */
52 static int dotsyms = 1;
54 /* Whether to run tls optimization. */
55 static int no_tls_opt = 0;
57 /* Whether to run opd optimization. */
58 static int no_opd_opt = 0;
60 /* Whether to convert inline PLT calls to direct. */
61 static int no_inline_opt = 0;
63 /* Whether to run toc optimization. */
64 static int no_toc_opt = 0;
66 /* Whether to sort input toc and got sections. */
67 static int no_toc_sort = 0;
69 /* Input .toc sections will be placed in this output section. */
70 static const char *toc_section_name = ".got";
71 static asection *toc_section = 0;
73 /* This is called before the input files are opened. We create a new
74 fake input file to hold the stub sections. */
77 ppc_create_output_section_statements (void)
79 if (!(bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
80 && elf_object_id (link_info.output_bfd) == PPC64_ELF_DATA))
83 link_info.wrap_char = '.';
85 stub_file = lang_add_input_file ("linker stubs",
86 lang_input_file_is_fake_enum,
88 stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd);
89 if (stub_file->the_bfd == NULL
90 || !bfd_set_arch_mach (stub_file->the_bfd,
91 bfd_get_arch (link_info.output_bfd),
92 bfd_get_mach (link_info.output_bfd)))
94 einfo (_("%F%P: can not create BFD: %E\n"));
98 stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
99 ldlang_add_file (stub_file);
100 params.stub_bfd = stub_file->the_bfd;
101 if (params.save_restore_funcs < 0)
102 params.save_restore_funcs = !bfd_link_relocatable (&link_info);
103 if (!ppc64_elf_init_stub_bfd (&link_info, ¶ms))
104 einfo (_("%F%P: can not init BFD: %E\n"));
107 /* Called after opening files but before mapping sections. */
110 ppc_after_open (void)
112 if (stub_file != NULL && link_info.relro && params.object_in_toc)
114 /* We have a .toc section that might be written to at run time.
115 Don't put .toc into the .got output section. */
116 lang_output_section_statement_type *got;
118 got = lang_output_section_find (".got");
121 lang_statement_union_type *s;
122 for (s = got->children.head; s != NULL; s = s->header.next)
123 if (s->header.type == lang_wild_statement_enum
124 && s->wild_statement.filename == NULL)
126 struct wildcard_list **i = &s->wild_statement.section_list;
128 if (strcmp ((*i)->spec.name, ".toc") == 0)
133 /* Instead, .toc input sections will be mapped to the
134 read/write .toc output section. If user scripts don't
135 provide one then we'll lose toc sorting and multi-toc. */
136 toc_section_name = ".toc";
139 gld${EMULATION_NAME}_after_open ();
142 /* Move the input section statement at *U which happens to be on LIST
143 to be just before *TO. */
146 move_input_section (lang_statement_list_type *list,
147 lang_statement_union_type **u,
148 lang_statement_union_type **to)
150 lang_statement_union_type *s = *u;
151 asection *i = s->input_section.section;
154 /* Snip the input section from the statement list. If it was the
155 last statement, fix the list tail pointer. */
159 /* Add it back in the new position. */
160 s->header.next = *to;
162 if (list->tail == to)
163 list->tail = &s->header.next;
165 /* Trim I off the bfd map_head/map_tail doubly linked lists. */
168 (p != NULL ? p : i->output_section)->map_head.s = n;
169 (n != NULL ? n : i->output_section)->map_tail.s = p;
171 /* Add I back on in its new position. */
172 if (s->header.next->header.type == lang_input_section_enum)
174 n = s->header.next->input_section.section;
179 /* If the next statement is not an input section statement then
180 TO must point at the previous input section statement
181 header.next field. */
182 lang_input_section_type *prev = (lang_input_section_type *)
183 ((char *) to - offsetof (lang_statement_union_type, header.next));
185 ASSERT (prev->header.type == lang_input_section_enum);
191 (p != NULL ? p : i->output_section)->map_head.s = i;
192 (n != NULL ? n : i->output_section)->map_tail.s = i;
195 /* Sort input section statements in the linker script tree rooted at
196 LIST so that those whose owning bfd happens to have a section
197 called .init or .fini are placed first. Place any TOC sections
198 referenced by small TOC relocs next, with TOC sections referenced
199 only by bigtoc relocs last. */
202 sort_toc_sections (lang_statement_list_type *list,
203 lang_statement_union_type **ini,
204 lang_statement_union_type **small)
206 lang_statement_union_type *s, **u;
210 while ((s = *u) != NULL)
212 switch (s->header.type)
214 case lang_wild_statement_enum:
215 sort_toc_sections (&s->wild_statement.children, ini, small);
218 case lang_group_statement_enum:
219 sort_toc_sections (&s->group_statement.children, ini, small);
222 case lang_input_section_enum:
223 i = s->input_section.section;
224 /* Leave the stub_file .got where it is. We put the .got
226 if (i->owner == stub_file->the_bfd)
228 if (bfd_get_section_by_name (i->owner, ".init") != NULL
229 || bfd_get_section_by_name (i->owner, ".fini") != NULL)
231 if (ini != NULL && *ini != s)
233 move_input_section (list, u, ini);
235 small = &s->header.next;
236 ini = &s->header.next;
240 small = &s->header.next;
241 ini = &s->header.next;
244 else if (ini == NULL)
247 if (ppc64_elf_has_small_toc_reloc (i))
249 if (small != NULL && *small != s)
251 move_input_section (list, u, small);
252 small = &s->header.next;
255 small = &s->header.next;
257 else if (small == NULL)
269 prelim_size_sections (void)
271 if (expld.phase != lang_mark_phase_enum)
273 expld.phase = lang_mark_phase_enum;
274 expld.dataseg.phase = exp_seg_none;
275 one_lang_size_sections_pass (NULL, false);
276 /* We must not cache anything from the preliminary sizing. */
277 lang_reset_memory_regions ();
282 ppc_before_allocation (void)
284 if (stub_file != NULL)
287 && !ppc64_elf_edit_opd (&link_info))
288 einfo (_("%X%P: can not edit %s: %E\n"), "opd");
291 && !bfd_link_relocatable (&link_info))
293 prelim_size_sections ();
295 if (!ppc64_elf_inline_plt (&link_info))
296 einfo (_("%X%P: inline PLT: %E\n"));
299 if (!ppc64_elf_tls_setup (&link_info))
300 einfo (_("%X%P: TLS problem %E\n"));
303 gld${EMULATION_NAME}_before_allocation ();
309 if (stub_file != NULL)
311 if (elf_hash_table (&link_info)->tls_sec != NULL
314 /* Size the sections. This is premature, but we want to know the
315 TLS segment layout so that certain optimizations can be done. */
316 prelim_size_sections ();
318 if (!ppc64_elf_tls_optimize (&link_info))
319 einfo (_("%X%P: TLS problem %E\n"));
323 && !bfd_link_relocatable (&link_info))
325 prelim_size_sections ();
327 if (!ppc64_elf_edit_toc (&link_info))
328 einfo (_("%X%P: can not edit %s: %E\n"), "toc");
333 lang_output_section_statement_type *toc_os;
335 toc_os = lang_output_section_find (toc_section_name);
337 sort_toc_sections (&toc_os->children, NULL, NULL);
342 struct hook_stub_info
344 lang_statement_list_type add;
345 asection *input_section;
348 /* Traverse the linker tree to find the spot where the stub goes. */
351 hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
353 lang_statement_union_type *l;
356 for (; (l = *lp) != NULL; lp = &l->header.next)
358 switch (l->header.type)
360 case lang_constructors_statement_enum:
361 ret = hook_in_stub (info, &constructor_list.head);
366 case lang_output_section_statement_enum:
367 ret = hook_in_stub (info,
368 &l->output_section_statement.children.head);
373 case lang_wild_statement_enum:
374 ret = hook_in_stub (info, &l->wild_statement.children.head);
379 case lang_group_statement_enum:
380 ret = hook_in_stub (info, &l->group_statement.children.head);
385 case lang_input_section_enum:
386 if (l->input_section.section == info->input_section)
388 /* We've found our section. Insert the stub immediately
389 before its associated input section. */
390 *lp = info->add.head;
391 *(info->add.tail) = l;
396 case lang_data_statement_enum:
397 case lang_reloc_statement_enum:
398 case lang_object_symbols_statement_enum:
399 case lang_output_statement_enum:
400 case lang_target_statement_enum:
401 case lang_input_statement_enum:
402 case lang_assignment_statement_enum:
403 case lang_padding_statement_enum:
404 case lang_address_statement_enum:
405 case lang_fill_statement_enum:
417 /* Call-back for ppc64_elf_size_stubs. */
419 /* Create a new stub section, and arrange for it to be linked
420 immediately before INPUT_SECTION. */
423 ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
427 asection *output_section;
428 lang_output_section_statement_type *os;
429 struct hook_stub_info info;
431 flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
432 | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_KEEP);
433 stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd,
434 stub_sec_name, flags);
436 || !bfd_set_section_alignment (stub_sec, (params.plt_stub_align > 5
437 ? params.plt_stub_align
438 : params.plt_stub_align < -5
439 ? -params.plt_stub_align
443 output_section = input_section->output_section;
444 os = lang_output_section_get (output_section);
446 info.input_section = input_section;
447 lang_list_init (&info.add);
448 lang_add_section (&info.add, stub_sec, NULL, NULL, os);
450 if (info.add.head == NULL)
453 if (hook_in_stub (&info, &os->children.head))
457 einfo (_("%X%P: can not make stub section: %E\n"));
462 /* Another call-back for ppc64_elf_size_stubs. */
465 ppc_layout_sections_again (void)
467 /* If we have changed sizes of the stub sections, then we need
468 to recalculate all the section offsets. This may mean we need to
469 add even more stubs. */
470 ldelf_map_segments (true);
472 if (!bfd_link_relocatable (&link_info))
473 ppc64_elf_set_toc (&link_info, link_info.output_bfd);
475 need_laying_out = -1;
480 build_toc_list (lang_statement_union_type *statement)
482 if (statement->header.type == lang_input_section_enum)
484 asection *i = statement->input_section.section;
486 if (i->sec_info_type != SEC_INFO_TYPE_JUST_SYMS
487 && (i->flags & SEC_EXCLUDE) == 0
488 && i->output_section == toc_section)
490 if (!ppc64_elf_next_toc_section (&link_info, i))
491 einfo (_("%X%P: linker script separates .got and .toc\n"));
498 build_section_lists (lang_statement_union_type *statement)
500 if (statement->header.type == lang_input_section_enum)
502 asection *i = statement->input_section.section;
504 if (!bfd_input_just_syms (i->owner)
505 && (i->flags & SEC_EXCLUDE) == 0
506 && i->output_section != NULL
507 && i->output_section->owner == link_info.output_bfd)
509 if (!ppc64_elf_next_input_section (&link_info, i))
510 einfo (_("%X%P: can not size stub section: %E\n"));
516 /* Call the back-end function to set TOC base after we have placed all
519 gld${EMULATION_NAME}_after_allocation (void)
523 /* If generating a relocatable output file, then we don't have any
525 if (stub_file != NULL && !bfd_link_relocatable (&link_info))
527 ret = ppc64_elf_setup_section_lists (&link_info);
529 einfo (_("%X%P: can not size stub section: %E\n"));
532 ppc64_elf_start_multitoc_partition (&link_info);
534 if (!params.no_multi_toc)
536 toc_section = bfd_get_section_by_name (link_info.output_bfd,
538 if (toc_section != NULL)
539 lang_for_each_statement (build_toc_list);
542 if (ppc64_elf_layout_multitoc (&link_info)
543 && !params.no_multi_toc
544 && toc_section != NULL)
545 lang_for_each_statement (build_toc_list);
547 ppc64_elf_finish_multitoc_partition (&link_info);
549 lang_for_each_statement (build_section_lists);
551 if (!ppc64_elf_check_init_fini (&link_info))
552 einfo (_("%P: .init/.fini fragments use differing TOC pointers\n"));
554 /* Call into the BFD backend to do the real work. */
555 if (!ppc64_elf_size_stubs (&link_info))
556 einfo (_("%X%P: can not size stub section: %E\n"));
560 /* We can't parse and merge .eh_frame until the glink .eh_frame has
561 been generated. Otherwise the glink .eh_frame CIE won't be
562 merged with other CIEs, and worse, the glink .eh_frame FDEs won't
563 be listed in .eh_frame_hdr. */
564 ret = bfd_elf_discard_info (link_info.output_bfd, &link_info);
567 einfo (_("%X%P: .eh_frame/.stab edit: %E\n"));
573 /* Call map_segments regardless of the state of need_laying_out.
574 need_laying_out set to -1 means we have just laid everything out,
575 but ppc64_elf_size_stubs strips .branch_lt and .eh_frame if
576 unneeded, after ppc_layout_sections_again. Another call removes
577 these sections from the segment map. Their presence is
578 innocuous except for confusing ELF_SECTION_IN_SEGMENT. */
579 ldelf_map_segments (need_laying_out > 0);
581 if (need_laying_out != -1 && !bfd_link_relocatable (&link_info))
582 ppc64_elf_set_toc (&link_info, link_info.output_bfd);
586 /* Final emulation specific call. */
589 gld${EMULATION_NAME}_finish (void)
592 char *line, *endline;
594 /* e_entry on PowerPC64 points to the function descriptor for
595 _start. If _start is missing, default to the first function
596 descriptor in the .opd section. */
597 if (stub_file != NULL
598 && (elf_elfheader (link_info.output_bfd)->e_flags & EF_PPC64_ABI) == 1)
599 entry_section = ".opd";
601 if (params.emit_stub_syms < 0)
602 params.emit_stub_syms = 1;
603 if (stub_file != NULL
604 && !bfd_link_relocatable (&link_info)
605 && !ppc64_elf_build_stubs (&link_info, config.stats ? &msg : NULL))
606 einfo (_("%X%P: can not build stubs: %E\n"));
609 for (line = msg; line != NULL; line = endline)
611 endline = strchr (line, '\n');
614 fprintf (stderr, "%s: %s\n", program_name, line);
623 /* Add a pattern matching ".foo" for every "foo" in a version script.
625 The reason for doing this is that many shared library version
626 scripts export a selected set of functions or data symbols, forcing
631 . this; that; some; thing;
636 To make the above work for PowerPC64, we need to export ".this",
637 ".that" and so on, otherwise only the function descriptor syms are
638 exported. Lack of an exported function code sym may cause a
639 definition to be pulled in from a static library. */
641 static struct bfd_elf_version_expr *
642 gld${EMULATION_NAME}_new_vers_pattern (struct bfd_elf_version_expr *entry)
644 struct bfd_elf_version_expr *dot_entry;
649 || entry->pattern[0] == '.'
650 || (!entry->literal && entry->pattern[0] == '*'))
653 dot_entry = xmalloc (sizeof *dot_entry);
655 dot_entry->next = entry;
656 len = strlen (entry->pattern) + 2;
657 dot_pat = xmalloc (len);
659 memcpy (dot_pat + 1, entry->pattern, len - 1);
660 dot_entry->pattern = dot_pat;
661 dot_entry->script = 1;
667 if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
669 /* Special handling for embedded SPU executables. */
670 extern bool embedded_spu_file (lang_input_statement_type *, const char *);
673 ppc64_recognized_file (lang_input_statement_type *entry)
675 if (embedded_spu_file (entry, "-m64"))
678 return ldelf_load_symbols (entry);
681 LDEMUL_RECOGNIZED_FILE=ppc64_recognized_file
684 # Define some shell vars to insert bits of code into the standard elf
685 # parse_args and list_options functions.
687 PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
688 { "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
689 { "plt-static-chain", no_argument, NULL, OPTION_PLT_STATIC_CHAIN },
690 { "no-plt-static-chain", no_argument, NULL, OPTION_NO_PLT_STATIC_CHAIN },
691 { "plt-thread-safe", no_argument, NULL, OPTION_PLT_THREAD_SAFE },
692 { "no-plt-thread-safe", no_argument, NULL, OPTION_NO_PLT_THREAD_SAFE },
693 { "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN },
694 { "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN },
695 { "plt-localentry", optional_argument, NULL, OPTION_PLT_LOCALENTRY },
696 { "no-plt-localentry", no_argument, NULL, OPTION_NO_PLT_LOCALENTRY },
697 { "power10-stubs", optional_argument, NULL, OPTION_POWER10_STUBS },
698 { "no-pcrel-optimize", no_argument, NULL, OPTION_NO_PCREL_OPT },
699 { "no-power10-stubs", no_argument, NULL, OPTION_NO_POWER10_STUBS },
700 { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
701 { "no-emit-stub-syms", no_argument, NULL, OPTION_NO_STUBSYMS },
702 { "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
703 { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
704 { "save-restore-funcs", no_argument, NULL, OPTION_SAVRES },
705 { "no-save-restore-funcs", no_argument, NULL, OPTION_NO_SAVRES },
706 { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
707 { "tls-get-addr-optimize", no_argument, NULL, OPTION_TLS_GET_ADDR_OPT },
708 { "no-tls-get-addr-optimize", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_OPT },
709 { "tls-get-addr-regsave", no_argument, NULL, OPTION_TLS_GET_ADDR_REGSAVE },
710 { "no-tls-get-addr-regsave", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_REGSAVE},
711 { "no-opd-optimize", no_argument, NULL, OPTION_NO_OPD_OPT },
712 { "no-inline-optimize", no_argument, NULL, OPTION_NO_INLINE_OPT },
713 { "no-toc-optimize", no_argument, NULL, OPTION_NO_TOC_OPT },
714 { "no-multi-toc", no_argument, NULL, OPTION_NO_MULTI_TOC },
715 { "no-toc-sort", no_argument, NULL, OPTION_NO_TOC_SORT },
716 { "non-overlapping-opd", no_argument, NULL, OPTION_NON_OVERLAPPING_OPD },
719 PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'
721 --stub-group-size=N Maximum size of a group of input sections that\n\
722 can be handled by one stub section. A negative\n\
723 value locates all stubs before their branches\n\
724 (with a group size of -N), while a positive\n\
725 value allows two groups of input sections, one\n\
726 before, and one after each stub section.\n\
727 Values of +/-1 indicate the linker should\n\
728 choose suitable defaults.\n"
731 --plt-static-chain PLT call stubs should load r11'${DEFAULT_PLT_STATIC_CHAIN- (default)}'\n"
734 --no-plt-static-chain PLT call stubs should not load r11'${DEFAULT_PLT_STATIC_CHAIN+ (default)}'\n"
737 --plt-thread-safe PLT call stubs with load-load barrier\n"
740 --no-plt-thread-safe PLT call stubs without barrier\n"
743 --plt-align [=<align>] Align PLT call stubs to fit cache lines\n"
746 --no-plt-align Dont'\''t align individual PLT call stubs\n"
749 --plt-localentry Optimize calls to ELFv2 localentry:0 functions\n"
752 --no-plt-localentry Don'\''t optimize ELFv2 calls\n"
755 --power10-stubs [=auto] Use Power10 PLT call stubs (default auto)\n"
758 --no-pcrel-optimize Don'\''t perform R_PPC64_PCREL_OPT optimization\n"
761 --no-power10-stubs Don'\''t use Power10 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 --tls-get-addr-regsave Force register save __tls_get_addr stub\n"
799 --no-tls-get-addr-regsave Don'\''t use register save __tls_get_addr stub\n"
802 --no-opd-optimize Don'\''t optimize the OPD section\n"
805 --no-inline-optimize Don'\''t convert inline PLT to direct calls\n"
808 --no-toc-optimize Don'\''t optimize the TOC section\n"
811 --no-multi-toc Disallow automatic multiple toc sections\n"
814 --no-toc-sort Don'\''t sort TOC and GOT sections\n"
817 --non-overlapping-opd Canonicalize .opd, so that there are no\n\
818 overlapping .opd entries\n"
822 PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
823 case OPTION_STUBGROUP_SIZE:
826 params.group_size = bfd_scan_vma (optarg, &end, 0);
828 einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
832 case OPTION_PLT_STATIC_CHAIN:
833 params.plt_static_chain = 1;
836 case OPTION_NO_PLT_STATIC_CHAIN:
837 params.plt_static_chain = 0;
840 case OPTION_PLT_THREAD_SAFE:
841 params.plt_thread_safe = 1;
844 case OPTION_NO_PLT_THREAD_SAFE:
845 params.plt_thread_safe = 0;
848 case OPTION_PLT_ALIGN:
852 long val = strtol (optarg, &end, 0);
853 if (*end || (unsigned long) val + 8 > 16)
854 einfo (_("%F%P: invalid --plt-align `%s'\''\n"), optarg);
855 params.plt_stub_align = val;
858 params.plt_stub_align = 5;
861 case OPTION_NO_PLT_ALIGN:
862 params.plt_stub_align = 0;
865 case OPTION_PLT_LOCALENTRY:
866 params.plt_localentry0 = 1;
869 case OPTION_NO_PLT_LOCALENTRY:
870 params.plt_localentry0 = 0;
873 case OPTION_POWER10_STUBS:
876 if (strcasecmp (optarg, "auto") == 0)
877 params.power10_stubs = -1;
878 else if (strcasecmp (optarg, "yes") == 0)
879 params.power10_stubs = 1;
880 else if (strcasecmp (optarg, "no") == 0)
881 params.power10_stubs = 0;
883 einfo (_("%F%P: invalid --power10-stubs argument `%s'\''\n"),
887 params.power10_stubs = 1;
890 case OPTION_NO_POWER10_STUBS:
891 params.power10_stubs = 0;
894 case OPTION_NO_PCREL_OPT:
895 params.no_pcrel_opt = 1;
898 case OPTION_STUBSYMS:
899 params.emit_stub_syms = 1;
902 case OPTION_NO_STUBSYMS:
903 params.emit_stub_syms = 0;
910 case OPTION_NO_DOTSYMS:
915 params.save_restore_funcs = 1;
918 case OPTION_NO_SAVRES:
919 params.save_restore_funcs = 0;
922 case OPTION_NO_TLS_OPT:
926 case OPTION_TLS_GET_ADDR_OPT:
927 params.tls_get_addr_opt = 1;
930 case OPTION_NO_TLS_GET_ADDR_OPT:
931 params.tls_get_addr_opt = 0;
934 case OPTION_TLS_GET_ADDR_REGSAVE:
935 params.no_tls_get_addr_regsave = 0;
938 case OPTION_NO_TLS_GET_ADDR_REGSAVE:
939 params.no_tls_get_addr_regsave = 1;
942 case OPTION_NO_OPD_OPT:
946 case OPTION_NO_INLINE_OPT:
950 case OPTION_NO_TOC_OPT:
954 case OPTION_NO_MULTI_TOC:
955 params.no_multi_toc = 1;
958 case OPTION_NO_TOC_SORT:
962 case OPTION_NON_OVERLAPPING_OPD:
963 params.non_overlapping_opd = 1;
966 case OPTION_TRADITIONAL_FORMAT:
968 params.tls_get_addr_opt = 0;
971 params.no_multi_toc = 1;
973 params.plt_static_chain = 1;
974 params.no_pcrel_opt = 1;
978 # Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation
980 LDEMUL_NEW_VERS_PATTERN=gld${EMULATION_NAME}_new_vers_pattern
981 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements
982 LDEMUL_AFTER_OPEN=ppc_after_open
983 LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
984 LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
985 LDEMUL_FINISH=gld${EMULATION_NAME}_finish