Commit | Line | Data |
---|---|---|
5d1634d7 | 1 | /* PowerPC64-specific support for 64-bit ELF. |
250d07de | 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. |
5d1634d7 | 3 | |
cd123cb7 | 4 | This file is part of BFD, the Binary File Descriptor library. |
5d1634d7 | 5 | |
cd123cb7 NC |
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. | |
5d1634d7 | 10 | |
cd123cb7 NC |
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. | |
5d1634d7 | 15 | |
cd123cb7 NC |
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. */ | |
5d1634d7 | 20 | |
e7d1c40c AM |
21 | /* Used to pass info between ld and bfd. */ |
22 | struct ppc64_elf_params | |
23 | { | |
24 | /* Linker stub bfd. */ | |
25 | bfd *stub_bfd; | |
26 | ||
27 | /* Linker call-backs. */ | |
28 | asection * (*add_stub_section) (const char *, asection *); | |
29 | void (*layout_sections_again) (void); | |
c9405344 | 30 | void (*edit) (void); |
e7d1c40c AM |
31 | |
32 | /* Maximum size of a group of input sections that can be handled by | |
33 | one stub section. A value of +/-1 indicates the bfd back-end | |
34 | should use a suitable default size. */ | |
35 | bfd_signed_vma group_size; | |
36 | ||
37 | /* Whether to use a special call stub for __tls_get_addr. */ | |
7c9cf415 | 38 | int tls_get_addr_opt; |
e7d1c40c | 39 | |
9e7028aa AM |
40 | /* Whether the special call stub should save r4..r12. */ |
41 | int no_tls_get_addr_regsave; | |
42 | ||
e7d1c40c AM |
43 | /* Whether to allow multiple toc sections. */ |
44 | int no_multi_toc; | |
45 | ||
46 | /* Set if PLT call stubs should load r11. */ | |
47 | int plt_static_chain; | |
48 | ||
49 | /* Set if PLT call stubs need to be thread safe on power7+. */ | |
50 | int plt_thread_safe; | |
51 | ||
52 | /* Set if individual PLT call stubs should be aligned. */ | |
53 | int plt_stub_align; | |
54 | ||
f378ab09 AM |
55 | /* Set if PLT call stubs for localentry:0 functions should omit r2 save. */ |
56 | int plt_localentry0; | |
57 | ||
d3b10ee7 AM |
58 | /* Whether to use power10 instructions in linkage stubs. */ |
59 | int power10_stubs; | |
60 | ||
6738c8a7 AM |
61 | /* Whether R_PPC64_PCREL_OPT should be ignored. */ |
62 | int no_pcrel_opt; | |
63 | ||
e7d1c40c AM |
64 | /* Whether to canonicalize .opd so that there are no overlapping |
65 | .opd entries. */ | |
66 | int non_overlapping_opd; | |
67 | ||
68 | /* Whether to emit symbols for stubs. */ | |
69 | int emit_stub_syms; | |
7d4c687d AM |
70 | |
71 | /* Whether to generate out-of-line register save/restore for gcc -Os code. */ | |
72 | int save_restore_funcs; | |
dbd1e97e AM |
73 | |
74 | /* Set when a potential variable is detected in .toc. */ | |
75 | int object_in_toc; | |
e7d1c40c AM |
76 | }; |
77 | ||
0a1b45a2 | 78 | bool ppc64_elf_init_stub_bfd |
e7d1c40c | 79 | (struct bfd_link_info *, struct ppc64_elf_params *); |
0a1b45a2 | 80 | bool ppc64_elf_edit_opd |
e7d1c40c | 81 | (struct bfd_link_info *); |
0a1b45a2 | 82 | bool ppc64_elf_inline_plt |
3e04d765 | 83 | (struct bfd_link_info *); |
0a1b45a2 | 84 | bool ppc64_elf_tls_setup |
e7d1c40c | 85 | (struct bfd_link_info *); |
0a1b45a2 | 86 | bool ppc64_elf_tls_optimize |
33c0ec9d | 87 | (struct bfd_link_info *); |
0a1b45a2 | 88 | bool ppc64_elf_edit_toc |
33c0ec9d | 89 | (struct bfd_link_info *); |
0a1b45a2 | 90 | bool ppc64_elf_has_small_toc_reloc |
1bbe0902 | 91 | (asection *); |
1c865ab2 | 92 | bfd_vma ppc64_elf_set_toc |
1d7c9635 | 93 | (struct bfd_link_info *, bfd *); |
721956f4 | 94 | int ppc64_elf_setup_section_lists |
e7d1c40c | 95 | (struct bfd_link_info *); |
927be08e AM |
96 | void ppc64_elf_start_multitoc_partition |
97 | (struct bfd_link_info *); | |
0a1b45a2 | 98 | bool ppc64_elf_next_toc_section |
4ce794b7 | 99 | (struct bfd_link_info *, asection *); |
0a1b45a2 | 100 | bool ppc64_elf_layout_multitoc |
927be08e AM |
101 | (struct bfd_link_info *); |
102 | void ppc64_elf_finish_multitoc_partition | |
103 | (struct bfd_link_info *); | |
0a1b45a2 | 104 | bool ppc64_elf_check_init_fini |
70cc837d | 105 | (struct bfd_link_info *); |
0a1b45a2 | 106 | bool ppc64_elf_next_input_section |
4ce794b7 | 107 | (struct bfd_link_info *, asection *); |
0a1b45a2 | 108 | bool ppc64_elf_size_stubs |
e7d1c40c | 109 | (struct bfd_link_info *); |
0a1b45a2 | 110 | bool ppc64_elf_build_stubs |
e7d1c40c | 111 | (struct bfd_link_info *, char **); |