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