elfxx-sparc.h revision 1.1.1.4.2.1 1 1.1 skrll /* SPARC ELF specific backend routines.
2 1.1.1.4.2.1 pgoyette Copyright (C) 2005-2016 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 skrll /* Short-cuts to get to dynamic linker sections. */
50 1.1 skrll asection *sdynbss;
51 1.1 skrll asection *srelbss;
52 1.1 skrll
53 1.1.1.2 christos union
54 1.1.1.2 christos {
55 1.1 skrll bfd_signed_vma refcount;
56 1.1 skrll bfd_vma offset;
57 1.1 skrll } tls_ldm_got;
58 1.1 skrll
59 1.1.1.2 christos /* Small local sym cache. */
60 1.1.1.2 christos struct sym_cache sym_cache;
61 1.1.1.2 christos
62 1.1.1.2 christos /* Used by local STT_GNU_IFUNC symbols. */
63 1.1.1.2 christos htab_t loc_hash_table;
64 1.1.1.2 christos void *loc_hash_memory;
65 1.1 skrll
66 1.1 skrll /* True if the target system is VxWorks. */
67 1.1 skrll int is_vxworks;
68 1.1 skrll
69 1.1 skrll /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks. */
70 1.1 skrll asection *srelplt2;
71 1.1 skrll
72 1.1 skrll void (*put_word) (bfd *, bfd_vma, void *);
73 1.1 skrll bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
74 1.1 skrll bfd_vma (*r_symndx) (bfd_vma);
75 1.1 skrll int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *);
76 1.1 skrll const char *dynamic_interpreter;
77 1.1 skrll int dynamic_interpreter_size;
78 1.1 skrll unsigned int word_align_power;
79 1.1 skrll unsigned int align_power_max;
80 1.1 skrll unsigned int plt_header_size;
81 1.1 skrll unsigned int plt_entry_size;
82 1.1 skrll int bytes_per_word;
83 1.1 skrll int bytes_per_rela;
84 1.1 skrll int dtpoff_reloc;
85 1.1 skrll int dtpmod_reloc;
86 1.1 skrll int tpoff_reloc;
87 1.1 skrll
88 1.1 skrll struct _bfd_sparc_elf_app_reg app_regs [4];
89 1.1 skrll };
90 1.1 skrll
91 1.1 skrll /* Get the SPARC ELF linker hash table from a link_info structure. */
92 1.1 skrll
93 1.1 skrll #define _bfd_sparc_elf_hash_table(p) \
94 1.1.1.2 christos (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
95 1.1.1.2 christos == SPARC_ELF_DATA ? ((struct _bfd_sparc_elf_link_hash_table *) ((p)->hash)) : NULL)
96 1.1 skrll
97 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup
98 1.1 skrll (bfd *, bfd_reloc_code_real_type);
99 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
100 1.1 skrll (bfd *, const char *);
101 1.1 skrll extern void _bfd_sparc_elf_info_to_howto
102 1.1 skrll (bfd *, arelent *, Elf_Internal_Rela *);
103 1.1 skrll extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
104 1.1 skrll (unsigned int);
105 1.1 skrll extern bfd_boolean _bfd_sparc_elf_mkobject
106 1.1 skrll (bfd *);
107 1.1 skrll extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
108 1.1 skrll (bfd *);
109 1.1 skrll extern bfd_boolean _bfd_sparc_elf_create_dynamic_sections
110 1.1 skrll (bfd *, struct bfd_link_info *);
111 1.1 skrll extern void _bfd_sparc_elf_copy_indirect_symbol
112 1.1 skrll (struct bfd_link_info *,
113 1.1 skrll struct elf_link_hash_entry *,
114 1.1 skrll struct elf_link_hash_entry *);
115 1.1 skrll extern bfd_boolean _bfd_sparc_elf_check_relocs
116 1.1 skrll (bfd *, struct bfd_link_info *,
117 1.1 skrll asection *, const Elf_Internal_Rela *);
118 1.1 skrll extern asection *_bfd_sparc_elf_gc_mark_hook
119 1.1 skrll (asection *, struct bfd_link_info *,
120 1.1 skrll Elf_Internal_Rela *, struct elf_link_hash_entry *,
121 1.1 skrll Elf_Internal_Sym *);
122 1.1 skrll extern bfd_boolean _bfd_sparc_elf_gc_sweep_hook
123 1.1 skrll (bfd *, struct bfd_link_info *,
124 1.1 skrll asection *, const Elf_Internal_Rela *);
125 1.1 skrll extern bfd_boolean _bfd_sparc_elf_adjust_dynamic_symbol
126 1.1 skrll (struct bfd_link_info *, struct elf_link_hash_entry *);
127 1.1 skrll extern bfd_boolean _bfd_sparc_elf_omit_section_dynsym
128 1.1 skrll (bfd *, struct bfd_link_info *, asection *);
129 1.1 skrll extern bfd_boolean _bfd_sparc_elf_size_dynamic_sections
130 1.1 skrll (bfd *, struct bfd_link_info *);
131 1.1 skrll extern bfd_boolean _bfd_sparc_elf_new_section_hook
132 1.1 skrll (bfd *, asection *);
133 1.1 skrll extern bfd_boolean _bfd_sparc_elf_relax_section
134 1.1 skrll (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
135 1.1 skrll extern bfd_boolean _bfd_sparc_elf_relocate_section
136 1.1 skrll (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
137 1.1 skrll Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
138 1.1 skrll extern bfd_boolean _bfd_sparc_elf_finish_dynamic_symbol
139 1.1 skrll (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
140 1.1 skrll Elf_Internal_Sym *sym);
141 1.1 skrll extern bfd_boolean _bfd_sparc_elf_finish_dynamic_sections
142 1.1 skrll (bfd *, struct bfd_link_info *);
143 1.1 skrll extern bfd_boolean _bfd_sparc_elf_object_p
144 1.1 skrll (bfd *);
145 1.1 skrll extern bfd_vma _bfd_sparc_elf_plt_sym_val
146 1.1 skrll (bfd_vma, const asection *, const arelent *);
147 1.1.1.3 christos extern bfd_boolean _bfd_sparc_elf_merge_private_bfd_data
148 1.1.1.3 christos (bfd *, bfd *);
149