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_putb64
, _do_getb32
, _do_putb32
, _do_getb16
, _do_putb16
,
103 /* Routines to byte-swap various sized integers from the file headers */
104 _do_getb64
, _do_putb64
, _do_getb32
, _do_putb32
, _do_getb16
, _do_putb16
,
106 /* bfd_check_format: check the format of a file being read */
107 { _bfd_dummy_target
, /* unknown format */
108 elf_object_p
, /* assembler/linker output (object file) */
109 bfd_generic_archive_p
, /* an archive */
110 elf_core_file_p
/* a core file */
113 /* bfd_set_format: set the format of a file being written */
116 _bfd_generic_mkarchive
,
120 /* bfd_write_contents: write cached information into a file being written */
122 elf_write_object_contents
,
123 _bfd_write_archive_contents
,
127 /* Initialize a jump table with the standard macro. All names start with
136 #ifdef TARGET_LITTLE_SYM
137 bfd_target TARGET_LITTLE_SYM
=
139 /* name: identify kind of target */
142 /* flavour: general indication about file */
143 bfd_target_elf_flavour
,
145 /* byteorder_big_p: data is big endian */
146 false, /* Nope -- this one's little endian */
148 /* header_byteorder_big_p: header is also big endian */
149 false, /* Nope -- this one's little endian */
151 /* object_flags: mask of all file flags */
152 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
|
155 /* section_flags: mask of all section flags */
156 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
|
159 /* leading_symbol_char: is the first char of a user symbol
160 predictable, and if so what is it */
163 /* ar_pad_char: pad character for filenames within an archive header
164 FIXME: this really has nothing to do with ELF, this is a characteristic
165 of the archiver and/or os and should be independently tunable */
168 /* ar_max_namelen: maximum number of characters in an archive header
169 FIXME: this really has nothing to do with ELF, this is a characteristic
170 of the archiver and should be independently tunable. This value is
171 a WAG (wild a** guess) */
174 /* align_power_min: minimum alignment restriction for any section
175 FIXME: this value may be target machine dependent */
178 /* Routines to byte-swap various sized integers from the data sections */
179 _do_getl64
, _do_putl64
, _do_getl32
, _do_putl32
, _do_getl16
, _do_putl16
,
181 /* Routines to byte-swap various sized integers from the file headers */
182 _do_getl64
, _do_putl64
, _do_getl32
, _do_putl32
, _do_getl16
, _do_putl16
,
184 /* bfd_check_format: check the format of a file being read */
185 { _bfd_dummy_target
, /* unknown format */
186 elf_object_p
, /* assembler/linker output (object file) */
187 bfd_generic_archive_p
, /* an archive */
188 elf_core_file_p
/* a core file */
191 /* bfd_set_format: set the format of a file being written */
194 _bfd_generic_mkarchive
,
198 /* bfd_write_contents: write cached information into a file being written */
200 elf_write_object_contents
,
201 _bfd_write_archive_contents
,
205 /* Initialize a jump table with the standard macro. All names start with