1 /* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
3 This file is part of BFD, the Binary File Diddler.
5 BFD is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 1, or (at your option)
10 BFD is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with BFD; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
31 /* Provided the symbol, returns the value reffed */
32 #define HOWTO_PREPARE(relocation, symbol) \
34 if (symbol != (asymbol *)NULL) { \
35 if (symbol->flags & BSF_FORT_COMM) { \
39 relocation = symbol->value; \
42 if (symbol->section != (asection *)NULL) { \
43 relocation += symbol->section->output_section->vma + \
44 symbol->section->output_offset; \
50 static bfd_reloc_status_enum_type
51 DEFUN(howto_hvrt16,(abfd, reloc_entry, symbol_in, data, ignore_input_section),
53 arelent *reloc_entry AND
54 asymbol *symbol_in AND
55 unsigned char *data AND
56 asection *ignore_input_section)
59 bfd_vma addr = reloc_entry->address;
60 long x = bfd_get_16(abfd, (bfd_byte *)data + addr);
62 HOWTO_PREPARE(relocation, symbol_in);
64 x = (x + relocation + reloc_entry->addend) >> 16;
66 bfd_put_16(abfd, x, (bfd_byte *)data + addr);
72 static reloc_howto_type howto_table[] =
74 HOWTO(R_PCR16L,02,1,16,true, 0,false,true,0,"PCR16L",false,0x0000ffff,0x0000ffff,true),
75 HOWTO(R_PCR26L,02,2,16,true, 0,false,true,0,"PCR26L",false,0x03ffffff,0x03ffffff,true),
76 HOWTO(R_VRT16, 00,1,16,false,0,false,true,0,"VRT16", false,0x0000ffff,0x0000ffff,true),
77 HOWTO(R_HVRT16,16,1,16,false,0,false,true,howto_hvrt16,"HVRT16",false,0x0000ffff,0x0000ffff,true),
78 HOWTO(R_LVRT16,00,1,16,false,0,false,true,0,"LVRT16",false,0x0000ffff,0x0000ffff,true),
79 HOWTO(R_VRT32, 00,2,32,false,0,false,true,0,"VRT32", false,0xffffffff,0xffffffff,true),
84 #define BADMAG(x) MC88BADMAG(x)
85 #include "coff-code.h"
90 #define coff_write_armap bsd_write_armap
93 bfd_target m88k_bcs_vec =
96 bfd_target_coff_flavour_enum,
97 true, /* data byte order is big */
98 true, /* header byte order is big */
100 (HAS_RELOC | EXEC_P | /* object flags */
101 HAS_LINENO | HAS_DEBUG |
102 HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
104 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
105 '/', /* ar_pad_char */
106 15, /* ar_max_namelen */
108 _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
109 _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
111 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
112 bfd_generic_archive_p, _bfd_dummy_target},
113 {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
115 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
116 _bfd_write_archive_contents, bfd_false},