1 /* PowerPC64-specific support for 64-bit ELF.
2 Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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,
19 MA 02110-1301, USA. */
21 /* Used to pass info between ld and bfd. */
22 struct ppc64_elf_params
24 /* Linker stub bfd. */
27 /* Linker call-backs. */
28 asection
* (*add_stub_section
) (const char *, asection
*);
29 void (*layout_sections_again
) (void);
31 /* Maximum size of a group of input sections that can be handled by
32 one stub section. A value of +/-1 indicates the bfd back-end
33 should use a suitable default size. */
34 bfd_signed_vma group_size
;
36 /* Whether to use a special call stub for __tls_get_addr. */
39 /* Whether to allow multiple toc sections. */
42 /* Set if PLT call stubs should load r11. */
45 /* Set if PLT call stubs need to be thread safe on power7+. */
48 /* Set if individual PLT call stubs should be aligned. */
51 /* Set if PLT call stubs for localentry:0 functions should omit r2 save. */
54 /* Whether to canonicalize .opd so that there are no overlapping
56 int non_overlapping_opd
;
58 /* Whether to emit symbols for stubs. */
61 /* Whether to generate out-of-line register save/restore for gcc -Os code. */
62 int save_restore_funcs
;
64 /* Set when a potential variable is detected in .toc. */
68 bfd_boolean ppc64_elf_init_stub_bfd
69 (struct bfd_link_info
*, struct ppc64_elf_params
*);
70 bfd_boolean ppc64_elf_edit_opd
71 (struct bfd_link_info
*);
72 asection
*ppc64_elf_tls_setup
73 (struct bfd_link_info
*);
74 bfd_boolean ppc64_elf_tls_optimize
75 (struct bfd_link_info
*);
76 bfd_boolean ppc64_elf_edit_toc
77 (struct bfd_link_info
*);
78 bfd_boolean ppc64_elf_has_small_toc_reloc
80 bfd_vma ppc64_elf_set_toc
81 (struct bfd_link_info
*, bfd
*);
82 int ppc64_elf_setup_section_lists
83 (struct bfd_link_info
*);
84 void ppc64_elf_start_multitoc_partition
85 (struct bfd_link_info
*);
86 bfd_boolean ppc64_elf_next_toc_section
87 (struct bfd_link_info
*, asection
*);
88 bfd_boolean ppc64_elf_layout_multitoc
89 (struct bfd_link_info
*);
90 void ppc64_elf_finish_multitoc_partition
91 (struct bfd_link_info
*);
92 bfd_boolean ppc64_elf_check_init_fini
93 (struct bfd_link_info
*);
94 bfd_boolean ppc64_elf_next_input_section
95 (struct bfd_link_info
*, asection
*);
96 bfd_boolean ppc64_elf_size_stubs
97 (struct bfd_link_info
*);
98 bfd_boolean ppc64_elf_build_stubs
99 (struct bfd_link_info
*, char **);