1 /* Target definitions for 32-bit ELF
2 Copyright 1993 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
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.
25 There are two such structures here: one for big-endian machines and
26 one for little-endian machines. */
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
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
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)
52 static CONST
struct elf_backend_data elf_bed
=
59 bfd_target TARGET_BIG_SYM
=
61 /* name: identify kind of target */
64 /* flavour: general indication about file */
65 bfd_target_elf_flavour
,
67 /* byteorder_big_p: data is big endian */
70 /* header_byteorder_big_p: header is also big endian */
73 /* object_flags: mask of all file flags */
74 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
77 /* section_flags: mask of all section flags */
78 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
81 /* leading_symbol_char: is the first char of a user symbol
82 predictable, and if so what is it */
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 */
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) */
96 /* align_power_min: minimum alignment restriction for any section
97 FIXME: this value may be target machine dependent */
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
,
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
,
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 */
117 /* bfd_set_format: set the format of a file being written */
120 _bfd_generic_mkarchive
,
124 /* bfd_write_contents: write cached information into a file being written */
126 elf_write_object_contents
,
127 _bfd_write_archive_contents
,
131 /* Initialize a jump table with the standard macro. All names start with
140 #ifdef TARGET_LITTLE_SYM
141 bfd_target TARGET_LITTLE_SYM
=
143 /* name: identify kind of target */
146 /* flavour: general indication about file */
147 bfd_target_elf_flavour
,
149 /* byteorder_big_p: data is big endian */
150 false, /* Nope -- this one's little endian */
152 /* header_byteorder_big_p: header is also big endian */
153 false, /* Nope -- this one's little endian */
155 /* object_flags: mask of all file flags */
156 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
159 /* section_flags: mask of all section flags */
160 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
163 /* leading_symbol_char: is the first char of a user symbol
164 predictable, and if so what is it */
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 */
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) */
178 /* align_power_min: minimum alignment restriction for any section
179 FIXME: this value may be target machine dependent */
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
,
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
,
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 */
199 /* bfd_set_format: set the format of a file being written */
202 _bfd_generic_mkarchive
,
206 /* bfd_write_contents: write cached information into a file being written */
208 elf_write_object_contents
,
209 _bfd_write_archive_contents
,
213 /* Initialize a jump table with the standard macro. All names start with