Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / elfxx-sparc.h
CommitLineData
22b75d0a 1/* SPARC ELF specific backend routines.
250d07de 2 Copyright (C) 2005-2021 Free Software Foundation, Inc.
22b75d0a 3
cd123cb7 4 This file is part of BFD, the Binary File Descriptor library.
22b75d0a 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.
22b75d0a 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.
22b75d0a 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. */
22b75d0a
DM
20
21#include "elf/common.h"
22#include "elf/internal.h"
23
24struct _bfd_sparc_elf_section_data
25{
26 struct bfd_elf_section_data elf;
27 unsigned int do_relax, reloc_count;
28};
29
30#define sec_do_relax(sec) \
31 ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->do_relax
32#define canon_reloc_count(sec) \
33 ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->reloc_count
34
35struct _bfd_sparc_elf_app_reg
36{
37 unsigned char bind;
38 unsigned short shndx;
39 bfd *abfd;
40 char *name;
41};
42
43/* Sparc ELF linker hash table. */
44
45struct _bfd_sparc_elf_link_hash_table
46{
47 struct elf_link_hash_table elf;
48
bb1dd176
QZ
49 /* Short-cut to get to dynamic linker sections. */
50 asection *interp;
51
4dfe6ac6
NC
52 union
53 {
22b75d0a
DM
54 bfd_signed_vma refcount;
55 bfd_vma offset;
56 } tls_ldm_got;
57
d0c9aeb3
DM
58 /* Used by local STT_GNU_IFUNC symbols. */
59 htab_t loc_hash_table;
60 void *loc_hash_memory;
61
910600e9
RS
62 /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks. */
63 asection *srelplt2;
64
22b75d0a 65 void (*put_word) (bfd *, bfd_vma, void *);
22b75d0a
DM
66 bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
67 bfd_vma (*r_symndx) (bfd_vma);
68 int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *);
c2e70a82 69 const char *dynamic_interpreter;
22b75d0a
DM
70 int dynamic_interpreter_size;
71 unsigned int word_align_power;
72 unsigned int align_power_max;
910600e9
RS
73 unsigned int plt_header_size;
74 unsigned int plt_entry_size;
22b75d0a
DM
75 int bytes_per_word;
76 int bytes_per_rela;
77 int dtpoff_reloc;
78 int dtpmod_reloc;
79 int tpoff_reloc;
80
81 struct _bfd_sparc_elf_app_reg app_regs [4];
82};
83
84/* Get the SPARC ELF linker hash table from a link_info structure. */
85
86#define _bfd_sparc_elf_hash_table(p) \
0f55320b
AM
87 ((is_elf_hash_table ((p)->hash) \
88 && elf_hash_table_id (elf_hash_table (p)) == SPARC_ELF_DATA) \
89 ? (struct _bfd_sparc_elf_link_hash_table *) (p)->hash : NULL)
22b75d0a
DM
90
91extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup
92 (bfd *, bfd_reloc_code_real_type);
157090f7
AM
93extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
94 (bfd *, const char *);
0a1b45a2 95extern bool _bfd_sparc_elf_info_to_howto
22b75d0a
DM
96 (bfd *, arelent *, Elf_Internal_Rela *);
97extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
0aa13fee 98 (bfd*, unsigned int);
0a1b45a2 99extern bool _bfd_sparc_elf_mkobject
22b75d0a
DM
100 (bfd *);
101extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
102 (bfd *);
0a1b45a2 103extern bool _bfd_sparc_elf_create_dynamic_sections
22b75d0a
DM
104 (bfd *, struct bfd_link_info *);
105extern void _bfd_sparc_elf_copy_indirect_symbol
fcfa13d2 106 (struct bfd_link_info *,
22b75d0a
DM
107 struct elf_link_hash_entry *,
108 struct elf_link_hash_entry *);
0a1b45a2 109extern bool _bfd_sparc_elf_check_relocs
22b75d0a
DM
110 (bfd *, struct bfd_link_info *,
111 asection *, const Elf_Internal_Rela *);
112extern asection *_bfd_sparc_elf_gc_mark_hook
113 (asection *, struct bfd_link_info *,
114 Elf_Internal_Rela *, struct elf_link_hash_entry *,
115 Elf_Internal_Sym *);
0a1b45a2 116extern bool _bfd_sparc_elf_adjust_dynamic_symbol
22b75d0a 117 (struct bfd_link_info *, struct elf_link_hash_entry *);
0a1b45a2 118extern bool _bfd_sparc_elf_omit_section_dynsym
22b75d0a 119 (bfd *, struct bfd_link_info *, asection *);
0a1b45a2 120extern bool _bfd_sparc_elf_size_dynamic_sections
22b75d0a 121 (bfd *, struct bfd_link_info *);
0a1b45a2 122extern bool _bfd_sparc_elf_new_section_hook
22b75d0a 123 (bfd *, asection *);
0a1b45a2
AM
124extern bool _bfd_sparc_elf_relax_section
125 (bfd *, struct bfd_section *, struct bfd_link_info *, bool *);
0f684201 126extern int _bfd_sparc_elf_relocate_section
22b75d0a
DM
127 (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
128 Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
0a1b45a2 129extern bool _bfd_sparc_elf_finish_dynamic_symbol
22b75d0a
DM
130 (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
131 Elf_Internal_Sym *sym);
0a1b45a2 132extern bool _bfd_sparc_elf_finish_dynamic_sections
22b75d0a 133 (bfd *, struct bfd_link_info *);
0a1b45a2 134extern bool _bfd_sparc_elf_fixup_symbol
bb1dd176 135 (struct bfd_link_info *, struct elf_link_hash_entry *);
0a1b45a2 136extern bool _bfd_sparc_elf_object_p
22b75d0a
DM
137 (bfd *);
138extern bfd_vma _bfd_sparc_elf_plt_sym_val
139 (bfd_vma, const asection *, const arelent *);
0a1b45a2 140extern bool _bfd_sparc_elf_merge_private_bfd_data
50e03d47 141 (bfd *, struct bfd_link_info *);
This page took 0.853618 seconds and 4 git commands to generate.