Back to index

cell-binutils  2.17cvs20070401
tc-crx.h
Go to the documentation of this file.
00001 /* tc-crx.h -- Header file for tc-crx.c, the CRX GAS port.
00002    Copyright 2004 Free Software Foundation, Inc.
00003 
00004    Contributed by Tomer Levi, NSC, Israel.
00005    Originally written for GAS 2.12 by Tomer Levi, NSC, Israel.
00006    Updates, BFDizing, GNUifying and ELF support by Tomer Levi.
00007 
00008    This file is part of GAS, the GNU Assembler.
00009 
00010    GAS is free software; you can redistribute it and/or modify
00011    it under the terms of the GNU General Public License as published by
00012    the Free Software Foundation; either version 2, or (at your option)
00013    any later version.
00014 
00015    GAS is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License
00021    along with GAS; see the file COPYING.  If not, write to the
00022    Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
00023    MA 02110-1301, USA.  */
00024 
00025 #ifndef TC_CRX_H
00026 #define TC_CRX_H
00027 
00028 #define TC_CRX 1
00029 
00030 #define TARGET_BYTES_BIG_ENDIAN 0
00031 
00032 #define TARGET_FORMAT "elf32-crx"
00033 #define TARGET_ARCH   bfd_arch_crx
00034 
00035 #define WORKING_DOT_WORD
00036 #define LOCAL_LABEL_PREFIX '.'
00037 
00038 #define md_undefined_symbol(s)     0
00039 #define md_number_to_chars  number_to_chars_littleendian
00040 
00041 /* We do relaxing in the assembler as well as the linker.  */
00042 extern const struct relax_type md_relax_table[];
00043 #define TC_GENERIC_RELAX_TABLE md_relax_table
00044 
00045 /* We do not want to adjust any relocations to make implementation of
00046    linker relaxations easier.  */
00047 #define tc_fix_adjustable(fixP)    0
00048 
00049 /* We need to force out some relocations when relaxing.  */
00050 #define TC_FORCE_RELOCATION(FIXP) crx_force_relocation (FIXP)
00051 extern int crx_force_relocation (struct fix *);
00052 
00053 /* Fixup debug sections since we will never relax them.  */
00054 #define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
00055 
00056 /* CRX instructions, with operands included, are a multiple
00057    of two bytes long.  */
00058 #define DWARF2_LINE_MIN_INSN_LENGTH 2
00059 
00060 /* This is called by emit_expr when creating a reloc for a cons.
00061    We could use the definition there, except that we want to handle 
00062    the CRX reloc type specially, rather than the BFD_RELOC type.  */
00063 #define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \
00064       fix_new_exp (FRAG, OFF, (int) LEN, EXP, 0, \
00065        LEN == 1 ? BFD_RELOC_CRX_NUM8 \
00066        : LEN == 2 ? BFD_RELOC_CRX_NUM16 \
00067        : LEN == 4 ? BFD_RELOC_CRX_NUM32 \
00068        : BFD_RELOC_NONE);
00069 
00070 /* Give an error if a frag containing code is not aligned to a 2-byte 
00071    boundary.  */
00072 #define md_frag_check(FRAGP) \
00073   if ((FRAGP)->has_code                                               \
00074       && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0)              \
00075      as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line,                \
00076                  _("instruction address is not a multiple of 2"));
00077 
00078 #endif /* TC_CRX_H */