1 /* tc-crx.h -- Header file for tc-crx.c, the CRX GAS port.
2 Copyright 2004 Free Software Foundation, Inc.
4 Contributed by Tomer Levi, NSC, Israel.
5 Originally written for GAS 2.12 by Tomer Levi, NSC, Israel.
6 Updates, BFDizing, GNUifying and ELF support by Tomer Levi.
8 This file is part of GAS, the GNU Assembler.
10 GAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 GAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GAS; see the file COPYING. If not, write to the
22 Free Software Foundation, 59 Temple Place - Suite 330, Boston,
23 MA 02111-1307, USA. */
30 #define TARGET_BYTES_BIG_ENDIAN 0
32 #define TARGET_FORMAT "elf32-crx"
33 #define TARGET_ARCH bfd_arch_crx
34 #define BFD_ARCH bfd_arch_crx
36 #define WORKING_DOT_WORD
37 #define NEED_FX_R_TYPE
38 #define LOCAL_LABEL_PREFIX '.'
40 #define md_undefined_symbol(s) 0
41 #define md_number_to_chars number_to_chars_littleendian
43 /* We do relaxing in the assembler as well as the linker. */
44 extern const struct relax_type md_relax_table
[];
45 #define TC_GENERIC_RELAX_TABLE md_relax_table
47 /* We do not want to adjust any relocations to make implementation of
48 linker relaxations easier. */
49 #define tc_fix_adjustable(fixP) 0
51 /* We need to force out some relocations when relaxing. */
52 #define TC_FORCE_RELOCATION(FIXP) crx_force_relocation (FIXP)
53 extern int crx_force_relocation (struct fix
*);
55 /* Fixup debug sections since we will never relax them. */
56 #define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
58 /* CRX instructions, with operands included, are a multiple
60 #define DWARF2_LINE_MIN_INSN_LENGTH 2
62 /* This is called by emit_expr when creating a reloc for a cons.
63 We could use the definition there, except that we want to handle
64 the CRX reloc type specially, rather than the BFD_RELOC type. */
65 #define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \
66 fix_new_exp (FRAG, OFF, (int) LEN, EXP, 0, \
67 LEN == 1 ? BFD_RELOC_CRX_NUM8 \
68 : LEN == 2 ? BFD_RELOC_CRX_NUM16 \
69 : LEN == 4 ? BFD_RELOC_CRX_NUM32 \
72 /* Give an error if a frag containing code is not aligned to a 2-byte
74 #define md_frag_check(FRAGP) \
75 if ((FRAGP)->has_code \
76 && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \
77 as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \
78 _("instruction address is not a multiple of 2"));