Back to index

cell-binutils  2.17cvs20070401
coff-we32k.c
Go to the documentation of this file.
00001 /* BFD back-end for we32k COFF files.
00002    Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003
00003    Free Software Foundation, Inc.
00004    Contributed by Brendan Kehoe (brendan@cs.widener.edu).
00005 
00006 This file is part of BFD, the Binary File Descriptor library.
00007 
00008 This program is free software; you can redistribute it and/or modify
00009 it under the terms of the GNU General Public License as published by
00010 the Free Software Foundation; either version 2 of the License, or
00011 (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00021 
00022 #include "bfd.h"
00023 #include "sysdep.h"
00024 #include "libbfd.h"
00025 #include "coff/we32k.h"
00026 #include "coff/internal.h"
00027 #include "libcoff.h"
00028 
00029 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
00030 
00031 static reloc_howto_type howto_table[] =
00032 {
00033     EMPTY_HOWTO (0),
00034     EMPTY_HOWTO (1),
00035     EMPTY_HOWTO (2),
00036     EMPTY_HOWTO (3),
00037     EMPTY_HOWTO (4),
00038     EMPTY_HOWTO (5),
00039   HOWTO(R_DIR32,            0,  2,        32, FALSE, 0,complain_overflow_bitfield, 0, "dir32",    TRUE, 0xffffffff,0xffffffff, FALSE),
00040     EMPTY_HOWTO (7),
00041     EMPTY_HOWTO (010),
00042     EMPTY_HOWTO (011),
00043     EMPTY_HOWTO (012),
00044     EMPTY_HOWTO (013),
00045     EMPTY_HOWTO (014),
00046     EMPTY_HOWTO (015),
00047     EMPTY_HOWTO (016),
00048   HOWTO(R_RELBYTE,          0,  0,        8,  FALSE, 0, complain_overflow_bitfield, 0, "8",       TRUE, 0x000000ff,0x000000ff, FALSE),
00049   HOWTO(R_RELWORD,          0,  1,        16, FALSE, 0, complain_overflow_bitfield, 0, "16",      TRUE, 0x0000ffff,0x0000ffff, FALSE),
00050   HOWTO(R_RELLONG,          0,  2,        32, FALSE, 0, complain_overflow_bitfield, 0, "32",      TRUE, 0xffffffff,0xffffffff, FALSE),
00051   HOWTO(R_PCRBYTE,          0,  0,        8,  TRUE,  0, complain_overflow_signed, 0, "DISP8",    TRUE, 0x000000ff,0x000000ff, FALSE),
00052   HOWTO(R_PCRWORD,          0,  1,        16, TRUE,  0, complain_overflow_signed, 0, "DISP16",   TRUE, 0x0000ffff,0x0000ffff, FALSE),
00053   HOWTO(R_PCRLONG,          0,  2,        32, TRUE,  0, complain_overflow_signed, 0, "DISP32",   TRUE, 0xffffffff,0xffffffff, FALSE),
00054 };
00055 
00056 /* Turn a howto into a reloc  nunmber */
00057 
00058 #define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
00059 #define BADMAG(x) WE32KBADMAG(x)
00060 #define WE32K 1
00061 
00062 #define RTYPE2HOWTO(cache_ptr, dst) \
00063            (cache_ptr)->howto = howto_table + (dst)->r_type;
00064 
00065 #include "coffcode.h"
00066 
00067 #define coff_write_armap bsd_write_armap
00068 
00069 CREATE_BIG_COFF_TARGET_VEC (we32kcoff_vec, "coff-we32k", 0, 0, 0, NULL, COFF_SWAP_TABLE)