ChangeLog rotatation and copyright year update
[deliverable/binutils-gdb.git] / bfd / elf32-xgate.h
CommitLineData
a8acc5fb 1/* Freescale XGATE-specific support for 32-bit ELF
b90efa5b 2 Copyright (C) 2012-2015 Free Software Foundation, Inc.
a8acc5fb
NC
3
4 Contributed by Sean Keys (skeys@ipdatasys.com)
5 (Heavily copied from the HC11 port by Stephane Carrez (stcarrez@nerim.fr))
6
7 This file is part of BFD, the Binary File Descriptor library.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 MA 02110-1301, USA. */
23
24#ifndef _ELF32_XGATE_H
25#define _ELF32_XGATE_H
26
27#include "elf-bfd.h"
28#include "bfdlink.h"
29#include "elf/xgate.h"
30
31/* Set and control ELF flags in ELF header. */
32extern bfd_boolean _bfd_xgate_elf_merge_private_bfd_data (bfd*,bfd*);
33extern bfd_boolean _bfd_xgate_elf_set_private_flags (bfd*,flagword);
34extern bfd_boolean _bfd_xgate_elf_print_private_bfd_data (bfd*, void*);
35
36struct elf32_xgate_stub_hash_entry
37{
38 /* Base hash table entry structure. */
39 struct bfd_hash_entry root;
40
41 /* The stub section. */
42 asection *stub_sec;
43
44 /* Offset within stub_sec of the beginning of this stub. */
45 bfd_vma stub_offset;
46
47 /* Given the symbol's value and its section we can determine its final
48 value when building the stubs (so the stub knows where to jump. */
49 bfd_vma target_value;
50 asection *target_section;
51};
52
53struct xgate_page_info
54{
55 bfd_vma bank_virtual;
56 bfd_vma bank_physical;
57 bfd_vma bank_physical_end;
58 bfd_vma bank_mask;
59 bfd_vma bank_size;
60 int bank_shift;
61 int bank_param_initialized;
62 bfd_vma trampoline_addr;
63};
64
65struct xgate_elf_link_hash_table
66{
67 struct elf_link_hash_table root;
68 struct xgate_page_info pinfo;
69
70 /* The stub hash table. */
71 struct bfd_hash_table* stub_hash_table;
72
73 /* Linker stub bfd. */
74 bfd *stub_bfd;
75
76 asection* stub_section;
77 asection* tramp_section;
78
79 /* Linker call-backs. */
80 asection * (*add_stub_section) (const char *, asection *);
81
82 /* Assorted information used by elf32_hppa_size_stubs. */
83 unsigned int bfd_count;
84 int top_index;
85 asection ** input_list;
86
87 /* Small local sym cache. */
88 struct sym_cache sym_cache;
89
90 bfd_boolean (*size_one_stub) (struct bfd_hash_entry*, void*);
91 bfd_boolean (*build_one_stub) (struct bfd_hash_entry*, void*);
92};
93
94/* Get the XGate ELF linker hash table from a link_info structure. */
95
96#define xgate_elf_hash_table(p) \
97 ((struct xgate_elf_link_hash_table *) ((p)->hash))
98
99/* Create a XGATE ELF linker hash table. */
100
101extern struct xgate_elf_link_hash_table* xgate_elf_hash_table_create
102 (bfd *);
a8acc5fb
NC
103
104extern void xgate_elf_get_bank_parameters (struct bfd_link_info *);
105
106/* Return 1 if the address is in banked memory.
107 This can be applied to a virtual address and to a physical address. */
108extern int xgate_addr_is_banked (struct xgate_page_info *, bfd_vma);
109
110/* Return the physical address seen by the processor, taking
111 into account banked memory. */
112extern bfd_vma xgate_phys_addr (struct xgate_page_info *, bfd_vma);
113
114/* Return the page number corresponding to an address in banked memory. */
115extern bfd_vma xgate_phys_page (struct xgate_page_info *, bfd_vma);
116
117bfd_reloc_status_type xgate_elf_ignore_reloc
118 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
119bfd_reloc_status_type xgate_elf_special_reloc
120 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
121
122bfd_boolean elf32_xgate_check_relocs
123 (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
124bfd_boolean elf32_xgate_relocate_section
125 (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
126 Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
127
128bfd_boolean elf32_xgate_add_symbol_hook
129 (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
130 flagword *, asection **, bfd_vma *);
131
132/* Tweak the OSABI field of the elf header. */
133extern void elf32_xgate_post_process_headers (bfd *, struct bfd_link_info *);
134
135int elf32_xgate_setup_section_lists (bfd *, struct bfd_link_info *);
136
137bfd_boolean elf32_xgate_size_stubs
138 (bfd *, bfd *, struct bfd_link_info *,
139 asection * (*) (const char *, asection *));
140
141bfd_boolean elf32_xgate_build_stubs (bfd * abfd, struct bfd_link_info *);
142
143#endif /* _ELF32_XGATE_H */
This page took 0.152874 seconds and 4 git commands to generate.