*** empty log message ***
[external/binutils.git] / bfd / coff-mips.c
1 /* MIPS Extended-Coff handler for Binary File Diddling.
2    Written by Per Bothner.  */
3
4 /* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
5
6 This file is part of BFD, the Binary File Diddler.
7
8 BFD is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 1, or (at your option)
11 any later version.
12
13 BFD is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with BFD; see the file COPYING.  If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22 /* This does not compile on anything but a MIPS yet (and I haven't been
23    able to test it there either since the latest merge!).  So it stays
24    out by default.  */
25
26 #include <sysdep.h>
27 #define MIPS 1
28 #if 0
29
30 #include <stdio.h>
31 #include <string.h>
32 #endif
33 #include "bfd.h"
34 #include "libbfd.h"
35
36
37 #include "intel-coff.h"
38 #include "libcoff.h"            /* to allow easier abstraction-breaking */
39
40 #define BADMAG(x) ECOFFBADMAG(x)
41
42 #include "coffcode.h"
43 bfd_target ecoff_little_vec =
44     {"ecoff-littlemips",      /* name */
45         bfd_target_coff_flavour_enum,
46         false,                  /* data byte order is little */
47         false,                  /* header byte order is little */
48
49         (HAS_RELOC | EXEC_P |   /* object flags */
50          HAS_LINENO | HAS_DEBUG |
51          HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
52
53         (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */
54         '/',                    /* ar_pad_char */
55         15,                     /* ar_max_namelen */
56 _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */
57 _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */
58
59         {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
60           bfd_generic_archive_p, _bfd_dummy_target},
61         {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */
62           bfd_false},
63         {bfd_false, coff_write_object_contents, bfd_false, bfd_false},
64         JUMP_TABLE (coff)
65 };
66
67 bfd_target ecoff_big_vec =
68     {"ecoff-bigmips",      /* name */
69         bfd_target_coff_flavour_enum,
70         true,                   /* data byte order is big */
71         true,                   /* header byte order is big */
72
73         (HAS_RELOC | EXEC_P |   /* object flags */
74          HAS_LINENO | HAS_DEBUG |
75          HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
76
77         (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */
78         ' ',                    /* ar_pad_char */
79         16,                     /* ar_max_namelen */
80 _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
81 _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
82         {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
83           bfd_generic_archive_p, _bfd_dummy_target},
84         {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */
85           bfd_false},
86         {bfd_false, coff_write_object_contents, /* bfd_write_contents */
87           bfd_false, bfd_false},
88         JUMP_TABLE(coff)
89 };