* libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>.
[deliverable/binutils-gdb.git] / bfd / elf32-target.h
1 /* Target definitions for 32-bit ELF
2 Copyright 1993 Free Software Foundation, Inc.
3
4 This file is part of BFD, the Binary File Descriptor library.
5
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 2 of the License, or
9 (at your option) any later version.
10
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.
15
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /* This structure contains everything that BFD knows about a target.
21 It includes things like its byte order, name, what routines to call
22 to do various operations, etc. Every BFD points to a target structure
23 with its "xvec" member.
24
25 There are two such structures here: one for big-endian machines and
26 one for little-endian machines. */
27
28 /* Archives are generic or unimplemented. */
29 #define elf_slurp_armap bfd_slurp_coff_armap
30 #define elf_slurp_extended_name_table _bfd_slurp_extended_name_table
31 #define elf_truncate_arname bfd_dont_truncate_arname
32 #define elf_openr_next_archived_file bfd_generic_openr_next_archived_file
33 #define elf_generic_stat_arch_elt bfd_generic_stat_arch_elt
34 #define elf_write_armap coff_write_armap
35
36 /* Ordinary section reading and writing */
37 #define elf_new_section_hook _bfd_dummy_new_section_hook
38 #define elf_get_section_contents bfd_generic_get_section_contents
39 /* #define elf_set_section_contents bfd_generic_set_section_contents */
40 #define elf_close_and_cleanup bfd_generic_close_and_cleanup
41
42 #define elf_bfd_debug_info_start bfd_void
43 #define elf_bfd_debug_info_end bfd_void
44 #define elf_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
45 #define elf_bfd_get_relocated_section_contents \
46 bfd_generic_get_relocated_section_contents
47 #define elf_bfd_relax_section bfd_generic_relax_section
48 #define elf_bfd_seclet_link bfd_generic_seclet_link
49 #define elf_bfd_make_debug_symbol \
50 ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
51
52 static CONST struct elf_backend_data elf_bed =
53 {
54 elf_info_to_howto,
55 ELF_ARCH,
56 };
57
58 #ifdef TARGET_BIG_SYM
59 bfd_target TARGET_BIG_SYM =
60 {
61 /* name: identify kind of target */
62 TARGET_BIG_NAME,
63
64 /* flavour: general indication about file */
65 bfd_target_elf_flavour,
66
67 /* byteorder_big_p: data is big endian */
68 true,
69
70 /* header_byteorder_big_p: header is also big endian */
71 true,
72
73 /* object_flags: mask of all file flags */
74 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
75 DYNAMIC | WP_TEXT),
76
77 /* section_flags: mask of all section flags */
78 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
79 SEC_CODE | SEC_DATA),
80
81 /* leading_symbol_char: is the first char of a user symbol
82 predictable, and if so what is it */
83 0,
84
85 /* ar_pad_char: pad character for filenames within an archive header
86 FIXME: this really has nothing to do with ELF, this is a characteristic
87 of the archiver and/or os and should be independently tunable */
88 '/',
89
90 /* ar_max_namelen: maximum number of characters in an archive header
91 FIXME: this really has nothing to do with ELF, this is a characteristic
92 of the archiver and should be independently tunable. This value is
93 a WAG (wild a** guess) */
94 15,
95
96 /* align_power_min: minimum alignment restriction for any section
97 FIXME: this value may be target machine dependent */
98 3,
99
100 /* Routines to byte-swap various sized integers from the data sections */
101 _do_getb64, _do_getb_signed_64, _do_putb64,
102 _do_getb32, _do_getb_signed_32, _do_putb32,
103 _do_getb16, _do_getb_signed_16, _do_putb16,
104
105 /* Routines to byte-swap various sized integers from the file headers */
106 _do_getb64, _do_getb_signed_64, _do_putb64,
107 _do_getb32, _do_getb_signed_32, _do_putb32,
108 _do_getb16, _do_getb_signed_16, _do_putb16,
109
110 /* bfd_check_format: check the format of a file being read */
111 { _bfd_dummy_target, /* unknown format */
112 elf_object_p, /* assembler/linker output (object file) */
113 bfd_generic_archive_p, /* an archive */
114 elf_core_file_p /* a core file */
115 },
116
117 /* bfd_set_format: set the format of a file being written */
118 { bfd_false,
119 elf_mkobject,
120 _bfd_generic_mkarchive,
121 bfd_false
122 },
123
124 /* bfd_write_contents: write cached information into a file being written */
125 { bfd_false,
126 elf_write_object_contents,
127 _bfd_write_archive_contents,
128 bfd_false
129 },
130
131 /* Initialize a jump table with the standard macro. All names start with
132 "elf" */
133 JUMP_TABLE(elf),
134
135 /* backend_data: */
136 (PTR) &elf_bed,
137 };
138 #endif
139
140 #ifdef TARGET_LITTLE_SYM
141 bfd_target TARGET_LITTLE_SYM =
142 {
143 /* name: identify kind of target */
144 TARGET_LITTLE_NAME,
145
146 /* flavour: general indication about file */
147 bfd_target_elf_flavour,
148
149 /* byteorder_big_p: data is big endian */
150 false, /* Nope -- this one's little endian */
151
152 /* header_byteorder_big_p: header is also big endian */
153 false, /* Nope -- this one's little endian */
154
155 /* object_flags: mask of all file flags */
156 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
157 DYNAMIC | WP_TEXT),
158
159 /* section_flags: mask of all section flags */
160 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
161 SEC_DATA),
162
163 /* leading_symbol_char: is the first char of a user symbol
164 predictable, and if so what is it */
165 0,
166
167 /* ar_pad_char: pad character for filenames within an archive header
168 FIXME: this really has nothing to do with ELF, this is a characteristic
169 of the archiver and/or os and should be independently tunable */
170 '/',
171
172 /* ar_max_namelen: maximum number of characters in an archive header
173 FIXME: this really has nothing to do with ELF, this is a characteristic
174 of the archiver and should be independently tunable. This value is
175 a WAG (wild a** guess) */
176 15,
177
178 /* align_power_min: minimum alignment restriction for any section
179 FIXME: this value may be target machine dependent */
180 3,
181
182 /* Routines to byte-swap various sized integers from the data sections */
183 _do_getl64, _do_getl_signed_64, _do_putl64,
184 _do_getl32, _do_getl_signed_32, _do_putl32,
185 _do_getl16, _do_getl_signed_16, _do_putl16,
186
187 /* Routines to byte-swap various sized integers from the file headers */
188 _do_getl64, _do_getl_signed_64, _do_putl64,
189 _do_getl32, _do_getl_signed_32, _do_putl32,
190 _do_getl16, _do_getl_signed_16, _do_putl16,
191
192 /* bfd_check_format: check the format of a file being read */
193 { _bfd_dummy_target, /* unknown format */
194 elf_object_p, /* assembler/linker output (object file) */
195 bfd_generic_archive_p, /* an archive */
196 elf_core_file_p /* a core file */
197 },
198
199 /* bfd_set_format: set the format of a file being written */
200 { bfd_false,
201 elf_mkobject,
202 _bfd_generic_mkarchive,
203 bfd_false
204 },
205
206 /* bfd_write_contents: write cached information into a file being written */
207 { bfd_false,
208 elf_write_object_contents,
209 _bfd_write_archive_contents,
210 bfd_false
211 },
212
213 /* Initialize a jump table with the standard macro. All names start with
214 "elf" */
215 JUMP_TABLE(elf),
216
217 /* backend_data: */
218 (PTR) &elf_bed,
219 };
220 #endif
This page took 0.034096 seconds and 5 git commands to generate.