elfxx-sparc.h revision 1.1.1.6 1 1.1 skrll /* SPARC ELF specific backend routines.
2 1.1.1.6 christos Copyright (C) 2005-2018 Free Software Foundation, Inc.
3 1.1 skrll
4 1.1 skrll This file is part of BFD, the Binary File Descriptor library.
5 1.1 skrll
6 1.1 skrll This program is free software; you can redistribute it and/or modify
7 1.1 skrll it under the terms of the GNU General Public License as published by
8 1.1 skrll the Free Software Foundation; either version 3 of the License, or
9 1.1 skrll (at your option) any later version.
10 1.1 skrll
11 1.1 skrll This program is distributed in the hope that it will be useful,
12 1.1 skrll but WITHOUT ANY WARRANTY; without even the implied warranty of
13 1.1 skrll MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 1.1 skrll GNU General Public License for more details.
15 1.1 skrll
16 1.1 skrll You should have received a copy of the GNU General Public License
17 1.1 skrll along with this program; if not, write to the Free Software
18 1.1 skrll Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 1.1 skrll MA 02110-1301, USA. */
20 1.1 skrll
21 1.1 skrll #include "elf/common.h"
22 1.1 skrll #include "elf/internal.h"
23 1.1 skrll
24 1.1 skrll struct _bfd_sparc_elf_section_data
25 1.1 skrll {
26 1.1 skrll struct bfd_elf_section_data elf;
27 1.1 skrll unsigned int do_relax, reloc_count;
28 1.1 skrll };
29 1.1 skrll
30 1.1 skrll #define sec_do_relax(sec) \
31 1.1 skrll ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->do_relax
32 1.1 skrll #define canon_reloc_count(sec) \
33 1.1 skrll ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->reloc_count
34 1.1 skrll
35 1.1 skrll struct _bfd_sparc_elf_app_reg
36 1.1 skrll {
37 1.1 skrll unsigned char bind;
38 1.1 skrll unsigned short shndx;
39 1.1 skrll bfd *abfd;
40 1.1 skrll char *name;
41 1.1 skrll };
42 1.1 skrll
43 1.1 skrll /* Sparc ELF linker hash table. */
44 1.1 skrll
45 1.1 skrll struct _bfd_sparc_elf_link_hash_table
46 1.1 skrll {
47 1.1 skrll struct elf_link_hash_table elf;
48 1.1 skrll
49 1.1.1.6 christos /* Short-cut to get to dynamic linker sections. */
50 1.1.1.6 christos asection *interp;
51 1.1 skrll
52 1.1.1.2 christos union
53 1.1.1.2 christos {
54 1.1 skrll bfd_signed_vma refcount;
55 1.1 skrll bfd_vma offset;
56 1.1 skrll } tls_ldm_got;
57 1.1 skrll
58 1.1.1.2 christos /* Small local sym cache. */
59 1.1.1.2 christos struct sym_cache sym_cache;
60 1.1.1.2 christos
61 1.1.1.2 christos /* Used by local STT_GNU_IFUNC symbols. */
62 1.1.1.2 christos htab_t loc_hash_table;
63 1.1.1.2 christos void *loc_hash_memory;
64 1.1 skrll
65 1.1 skrll /* True if the target system is VxWorks. */
66 1.1 skrll int is_vxworks;
67 1.1 skrll
68 1.1 skrll /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks. */
69 1.1 skrll asection *srelplt2;
70 1.1 skrll
71 1.1 skrll void (*put_word) (bfd *, bfd_vma, void *);
72 1.1 skrll bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
73 1.1 skrll bfd_vma (*r_symndx) (bfd_vma);
74 1.1 skrll int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *);
75 1.1 skrll const char *dynamic_interpreter;
76 1.1 skrll int dynamic_interpreter_size;
77 1.1 skrll unsigned int word_align_power;
78 1.1 skrll unsigned int align_power_max;
79 1.1 skrll unsigned int plt_header_size;
80 1.1 skrll unsigned int plt_entry_size;
81 1.1 skrll int bytes_per_word;
82 1.1 skrll int bytes_per_rela;
83 1.1 skrll int dtpoff_reloc;
84 1.1 skrll int dtpmod_reloc;
85 1.1 skrll int tpoff_reloc;
86 1.1 skrll
87 1.1 skrll struct _bfd_sparc_elf_app_reg app_regs [4];
88 1.1 skrll };
89 1.1 skrll
90 1.1 skrll /* Get the SPARC ELF linker hash table from a link_info structure. */
91 1.1 skrll
92 1.1 skrll #define _bfd_sparc_elf_hash_table(p) \
93 1.1.1.2 christos (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
94 1.1.1.2 christos == SPARC_ELF_DATA ? ((struct _bfd_sparc_elf_link_hash_table *) ((p)->hash)) : NULL)
95 1.1 skrll
96 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup
97 1.1 skrll (bfd *, bfd_reloc_code_real_type);
98 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
99 1.1 skrll (bfd *, const char *);
100 1.1 skrll extern void _bfd_sparc_elf_info_to_howto
101 1.1 skrll (bfd *, arelent *, Elf_Internal_Rela *);
102 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
103 1.1 skrll (unsigned int);
104 1.1 skrll extern bfd_boolean _bfd_sparc_elf_mkobject
105 1.1 skrll (bfd *);
106 1.1 skrll extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
107 1.1 skrll (bfd *);
108 1.1 skrll extern bfd_boolean _bfd_sparc_elf_create_dynamic_sections
109 1.1 skrll (bfd *, struct bfd_link_info *);
110 1.1 skrll extern void _bfd_sparc_elf_copy_indirect_symbol
111 1.1 skrll (struct bfd_link_info *,
112 1.1 skrll struct elf_link_hash_entry *,
113 1.1 skrll struct elf_link_hash_entry *);
114 1.1 skrll extern bfd_boolean _bfd_sparc_elf_check_relocs
115 1.1 skrll (bfd *, struct bfd_link_info *,
116 1.1 skrll asection *, const Elf_Internal_Rela *);
117 1.1 skrll extern asection *_bfd_sparc_elf_gc_mark_hook
118 1.1 skrll (asection *, struct bfd_link_info *,
119 1.1 skrll Elf_Internal_Rela *, struct elf_link_hash_entry *,
120 1.1 skrll Elf_Internal_Sym *);
121 1.1 skrll extern bfd_boolean _bfd_sparc_elf_adjust_dynamic_symbol
122 1.1 skrll (struct bfd_link_info *, struct elf_link_hash_entry *);
123 1.1 skrll extern bfd_boolean _bfd_sparc_elf_omit_section_dynsym
124 1.1 skrll (bfd *, struct bfd_link_info *, asection *);
125 1.1 skrll extern bfd_boolean _bfd_sparc_elf_size_dynamic_sections
126 1.1 skrll (bfd *, struct bfd_link_info *);
127 1.1 skrll extern bfd_boolean _bfd_sparc_elf_new_section_hook
128 1.1 skrll (bfd *, asection *);
129 1.1 skrll extern bfd_boolean _bfd_sparc_elf_relax_section
130 1.1 skrll (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
131 1.1 skrll extern bfd_boolean _bfd_sparc_elf_relocate_section
132 1.1 skrll (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
133 1.1 skrll Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
134 1.1 skrll extern bfd_boolean _bfd_sparc_elf_finish_dynamic_symbol
135 1.1 skrll (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
136 1.1 skrll Elf_Internal_Sym *sym);
137 1.1 skrll extern bfd_boolean _bfd_sparc_elf_finish_dynamic_sections
138 1.1 skrll (bfd *, struct bfd_link_info *);
139 1.1.1.6 christos extern bfd_boolean _bfd_sparc_elf_fixup_symbol
140 1.1.1.6 christos (struct bfd_link_info *, struct elf_link_hash_entry *);
141 1.1 skrll extern bfd_boolean _bfd_sparc_elf_object_p
142 1.1 skrll (bfd *);
143 1.1 skrll extern bfd_vma _bfd_sparc_elf_plt_sym_val
144 1.1 skrll (bfd_vma, const asection *, const arelent *);
145 1.1.1.3 christos extern bfd_boolean _bfd_sparc_elf_merge_private_bfd_data
146 1.1.1.6 christos (bfd *, struct bfd_link_info *);
147