1 /* Intel i386 Mach-O support for BFD.
3 Free Software Foundation, Inc.
5 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
26 #include "libiberty.h"
28 #define bfd_mach_o_object_p bfd_mach_o_i386_object_p
29 #define bfd_mach_o_core_p bfd_mach_o_i386_core_p
30 #define bfd_mach_o_mkobject bfd_mach_o_i386_mkobject
32 static const bfd_target
*
33 bfd_mach_o_i386_object_p (bfd
*abfd
)
35 return bfd_mach_o_header_p (abfd
, 0, BFD_MACH_O_CPU_TYPE_I386
);
38 static const bfd_target
*
39 bfd_mach_o_i386_core_p (bfd
*abfd
)
41 return bfd_mach_o_header_p (abfd
,
42 BFD_MACH_O_MH_CORE
, BFD_MACH_O_CPU_TYPE_I386
);
46 bfd_mach_o_i386_mkobject (bfd
*abfd
)
48 bfd_mach_o_data_struct
*mdata
;
50 if (!bfd_mach_o_mkobject_init (abfd
))
53 mdata
= abfd
->tdata
.mach_o_data
;
54 mdata
->header
.magic
= BFD_MACH_O_MH_MAGIC
;
55 mdata
->header
.cputype
= BFD_MACH_O_CPU_TYPE_I386
;
56 mdata
->header
.cpusubtype
= BFD_MACH_O_CPU_SUBTYPE_X86_ALL
;
57 mdata
->header
.filetype
= BFD_MACH_O_MH_OBJECT
;
58 mdata
->header
.byteorder
= BFD_ENDIAN_LITTLE
;
59 mdata
->header
.version
= 1;
64 #define TARGET_NAME mach_o_i386_vec
65 #define TARGET_STRING "mach-o-i386"
66 #define TARGET_BIG_ENDIAN 0
67 #define TARGET_ARCHIVE 0
69 #include "mach-o-target.c"