Consolidate ppc64 ld/bfd communication
[external/binutils.git] / bfd / elf64-ppc.h
1 /* PowerPC64-specific support for 64-bit ELF.
2    Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011, 2012
3    Free Software Foundation, Inc.
4
5    This file is part of BFD, the Binary File Descriptor library.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20    MA 02110-1301, USA.  */
21
22 /* Used to pass info between ld and bfd.  */
23 struct ppc64_elf_params
24 {
25   /* Linker stub bfd.  */
26   bfd *stub_bfd;
27
28   /* Linker call-backs.  */
29   asection * (*add_stub_section) (const char *, asection *);
30   void (*layout_sections_again) (void);
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.  */
38   int no_tls_get_addr_opt;
39
40   /* Whether to allow multiple toc sections.  */
41   int no_multi_toc;
42
43   /* Set if PLT call stubs should load r11.  */
44   int plt_static_chain;
45
46   /* Set if PLT call stubs need to be thread safe on power7+.  */
47   int plt_thread_safe;
48
49   /* Set if individual PLT call stubs should be aligned.  */
50   int plt_stub_align;
51
52   /* Whether to canonicalize .opd so that there are no overlapping
53      .opd entries.  */
54   int non_overlapping_opd;
55
56   /* Whether to emit symbols for stubs.  */
57   int emit_stub_syms;
58 };
59
60 bfd_boolean ppc64_elf_init_stub_bfd
61   (struct bfd_link_info *, struct ppc64_elf_params *);
62 bfd_boolean ppc64_elf_edit_opd
63   (struct bfd_link_info *);
64 asection *ppc64_elf_tls_setup
65   (struct bfd_link_info *);
66 bfd_boolean ppc64_elf_tls_optimize
67   (struct bfd_link_info *);
68 bfd_boolean ppc64_elf_edit_toc
69   (struct bfd_link_info *);
70 bfd_boolean ppc64_elf_has_small_toc_reloc
71   (asection *);
72 bfd_vma ppc64_elf_set_toc
73 (struct bfd_link_info *, bfd *);
74 int ppc64_elf_setup_section_lists
75   (struct bfd_link_info *);
76 void ppc64_elf_start_multitoc_partition
77   (struct bfd_link_info *);
78 bfd_boolean ppc64_elf_next_toc_section
79   (struct bfd_link_info *, asection *);
80 bfd_boolean ppc64_elf_layout_multitoc
81   (struct bfd_link_info *);
82 void ppc64_elf_finish_multitoc_partition
83   (struct bfd_link_info *);
84 bfd_boolean ppc64_elf_check_init_fini
85   (struct bfd_link_info *);
86 bfd_boolean ppc64_elf_next_input_section
87   (struct bfd_link_info *, asection *);
88 bfd_boolean ppc64_elf_size_stubs
89 (struct bfd_link_info *);
90 bfd_boolean ppc64_elf_build_stubs
91   (struct bfd_link_info *, char **);
92 void ppc64_elf_restore_symbols
93   (struct bfd_link_info *info);