2010-06-01 Rafael Espindola <espindola@google.com>
[binutils.git] / gas / config / tc-cr16.h
blob739317ffef36ec9957f05ca8be60d3b91ce695cc
1 /* tc-cr16.h -- Header file for tc-cr16.c, the CR16 GAS port.
2 Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
4 Contributed by M R Swami Reddy <MR.Swami.Reddy@nsc.com>
6 This file is part of GAS, the GNU Assembler.
8 GAS 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 3, or (at your option)
11 any later version.
13 GAS 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.
18 You should have received a copy of the GNU General Public License
19 along with GAS; see the file COPYING. If not, write to the
20 Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
23 #ifndef TC_CR16_H
24 #define TC_CR16_H
26 #define TC_CR16 1
28 #define TARGET_BYTES_BIG_ENDIAN 0
30 #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
32 #define TARGET_FORMAT "elf32-cr16"
33 #define TARGET_ARCH bfd_arch_cr16
35 #define WORKING_DOT_WORD
36 #define LOCAL_LABEL_PREFIX '.'
38 #define md_number_to_chars number_to_chars_littleendian
40 /* We do relaxing in the assembler as well as the linker. */
41 extern const struct relax_type md_relax_table[];
42 #define TC_GENERIC_RELAX_TABLE md_relax_table
44 /* We do not want to adjust any relocations to make implementation of
45 linker relaxations easier. */
46 #define tc_fix_adjustable(fixP) 0
48 /* We need to force out some relocations when relaxing. */
49 #define TC_FORCE_RELOCATION(FIXP) cr16_force_relocation (FIXP)
50 extern int cr16_force_relocation (struct fix *);
52 /* Fixup non-code sections since we will never relax them. */
53 #define TC_LINKRELAX_FIXUP(seg) \
54 ((seg->flags & (SEC_ALLOC | SEC_CODE)) == (SEC_ALLOC | SEC_CODE))
56 /* CR16 instructions, with operands included, are a multiple
57 of two bytes long. */
58 #define DWARF2_LINE_MIN_INSN_LENGTH 2
60 extern void cr16_cons_fix_new (struct frag *, int, int, struct expressionS *);
61 /* This is called by emit_expr when creating a reloc for a cons.
62 We could use the definition there, except that we want to handle
63 the CR16 reloc type specially, rather than the BFD_RELOC type. */
64 #define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \
65 cr16_cons_fix_new (FRAG, OFF, LEN, EXP)
67 /* Give an error if a frag containing code is not aligned to a 2-byte
68 boundary. */
69 #define md_frag_check(FRAGP) \
70 if ((FRAGP)->has_code \
71 && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \
72 as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \
73 _("instruction address is not a multiple of 2"));
75 #endif /* TC_CR16_H */